hibernate 多对多关系详解(包括中间表,一对多字表)
2012-05-25 11:13:59 来源:WEB开发网核心提示:.uniqueResult(); // Eager fetch the colleciton so we can use it detached System.out.println("session.getTransaction().commit();");session.getTransact
.uniqueResult(); // Eager fetch the colleciton so we can use it detached
System.out.println("session.getTransaction().commit();");
session.getTransaction().commit();
// End of first unit of work
aPerson.getEvents().add(anEvent); // aPerson is detached
// or bidirectional safety method, setting both sides: aPerson.addToEvent(anEvent);
// Begin second unit of work
Session session2 = HibernateUtil.
更多精彩
赞助商链接
