Hello,
We have a thick-client application, currently using JDO, that we are in the process of migrating to Hibernate. In our app, when the user creates a new Contact, for example, the generated Id for the new Contact is displayed on the screen. This is achieved by calling into our JDO implementation to get the next available Id: something like - JDOPersistenceManager.getNextId(className);
The user can then choose to persist the new Contact; if not, the Id is discarded. Another feature of our JDO implementation is that, when the user persists a new object, JDO checks if the object already has an Id set (as in the case above, when the app calls into JDO to get an Id). If not, it generates a new Id and sets it.
I was wondering if there was some way to replicate this functionality in Hibernate.
Thanks in advance, Sharath
|