Expert |
|
Joined: Tue May 13, 2008 3:42 pm Posts: 919 Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
|
The save method returns the primary key, even before the transaction is comitted. You can get the primary key that is about to be used, and set your other properties, and then do the commit. You'll only end up with one transaction through one Hibernate Session.
_________________ Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?" http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials
|
|