-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Tapping into Hibernate's Id generation mechanism
PostPosted: Wed Sep 30, 2009 7:58 am 
Newbie

Joined: Mon Aug 10, 2009 10:14 pm
Posts: 3
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.