-->
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: get the generated id from entity
PostPosted: Wed Sep 27, 2006 4:16 am 
Newbie

Joined: Thu Sep 14, 2006 4:12 am
Posts: 1
hi all !

i have an entity with generated id by sequence (ORACLE)

when i perform session.merge , the new value is generated in the DB

but it does not appear in the id attribute of the entity.

i need to read the new generated value
because i load the screen with the new record value.

how can i get the generated value ??

thanks a head .

Adiel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 27, 2006 7:55 am 
Newbie

Joined: Tue Sep 26, 2006 7:31 am
Posts: 8
Location: Oslo
Are you sure you have mapped the entity correctly?

Remember the id mapping, tex:

<id name="id" type="long" column="the_id_column">
<generator class="sequence">
<param name="sequence">name_of_sequence_in_db</param>
<generator>
</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.