-->
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.  [ 2 posts ] 
Author Message
 Post subject: Grabbing id generated back from session.save
PostPosted: Mon Jan 22, 2007 1:09 pm 
Newbie

Joined: Fri Jan 19, 2007 10:29 am
Posts: 4
Location: Ireland
Is there any easy way of retrieving back the serial that is generated for your new table record using the session.save() method?

I'm using the 'native' generator mapping currently.

Hibernate version:
3.2


Top
 Profile  
 
 Post subject: Actually very easy!
PostPosted: Mon Jan 22, 2007 1:28 pm 
Newbie

Joined: Fri Jan 19, 2007 10:29 am
Posts: 4
Location: Ireland
Actually, I just had to change my generator type from 'native' to 'increment' in the XML mapping file! Sorry about that!

<hibernate-mapping>

<class name="tables.Bond" table="bond">
<id name="bondNoSer" column="bond_no_ser">
<generator class="increment"/>
</id>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.