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: Oracle sequence, get value of id for just intserted row
PostPosted: Thu Mar 01, 2007 5:57 pm 
Newbie

Joined: Fri Jan 12, 2007 9:54 am
Posts: 4
I looked in the manual and search this list, without any luck.

When I do a SaveOrUpdate, how do I get the value of the Id of the record just inserted? The mapping file has the Id column as follows:


Code:
      <id name="Id" column="ID" type="Decimal">
         <generator class="sequence">
            <param name="sequence">APPLICATIONS_VW_seq</param>
         </generator>
      </id>



thanks
Don


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 01, 2007 6:08 pm 
Newbie

Joined: Fri Jan 12, 2007 9:54 am
Posts: 4
oops, sorry - found it. I was using SaveOrUpdate. I should have been using Save - it returns the 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.