hibernate 多对多关系详解(包括中间表,一对多字表)
2012-05-25 11:13:59 来源:WEB开发网核心提示:session.save(theEvent); session.getTransaction().commit(); return theEvent.getId();} private Long createAndStorePerson(String firstname, String lastname) { Sess
session.save(theEvent);
session.getTransaction().commit();
return theEvent.getId();
}
private Long createAndStorePerson(String firstname, String lastname) {
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
session.beginTransaction();
Person thePerson = new Person();
thePerson.setFirstname(firstname);
thePerson.setLastname(lastname);
更多精彩
赞助商链接