hibernate 多对多关系详解(包括中间表,一对多字表)
2012-05-25 11:13:59 来源:WEB开发网核心提示:HibernateUtil.getSessionFactory().close();} private Long createAndStoreEvent(String title, Date theDate) { Session session = HibernateUtil.getSessionFactory().g
HibernateUtil.getSessionFactory().close();
}
private Long createAndStoreEvent(String title, Date theDate) {
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
session.beginTransaction();
//theEvent is transient
Event theEvent = new Event();
theEvent.setTitle(title);
theEvent.setDate(theDate);
//theEvent turns to persistent
更多精彩
赞助商链接