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.  [ 3 posts ] 
Author Message
 Post subject: Inserted Id
PostPosted: Mon Jun 16, 2008 8:24 am 
Newbie

Joined: Wed Apr 16, 2008 1:20 pm
Posts: 16
Hi All,

In the moment of the Session.Save(object) is there a quick way to retrive the ID generated from this insert? Off course the id is set to "increment" in the .hbm.

Thanks

_________________
Weekend PLEASE!!!!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 16, 2008 8:59 am 
Expert
Expert

Joined: Thu Dec 14, 2006 5:57 am
Posts: 1185
Location: Zurich, Switzerland
I'm not sure, when "increment" id's are generated, but from reading the docs, I assume, hibernate is doing it. Otherwise there's no way, since the id is generated during session.Flush(). Then the id is generated during session.Save(obj), so it should be accessible via the id property after that.

_________________
--Wolfgang


Top
 Profile  
 
 Post subject: Getting the ID of the just inserted record
PostPosted: Tue Jun 17, 2008 3:39 am 
Newbie

Joined: Tue Jun 17, 2008 3:26 am
Posts: 7
I am still trying to determine if there is a generic way in which NHibernate would automatically get the ID of the record that was just inserted, and that could be in case of Oracle or MSSQL as the RDBMS. Is this not a common enough need to have a solution in NHibernate?


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

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.