-->
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: retriving auto-incerement id
PostPosted: Tue Jul 25, 2006 5:22 am 
Newbie

Joined: Tue Jul 25, 2006 5:04 am
Posts: 4
Hi friends,
i have an entity object and its identifier is an "Embeddable" id class and this composite id class has an auto-increment id field.

I can not retrieve the auto-increment id relating to my composite id class after saving the entity object.How can i reach the auto-id?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 25, 2006 6:56 am 
Beginner
Beginner

Joined: Tue Jul 04, 2006 11:29 am
Posts: 20
Location: Cambs, UK
What do you get returned when you call session.save()? From the way you described your code, you should get your ID class returned. From that you should be able to use it's id getter method to retrieve what you need.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 25, 2006 8:04 am 
Newbie

Joined: Tue Jul 25, 2006 5:04 am
Posts: 4
I agree with you Leesy. It does that things you wrote if i have only one id field-not composite id. When i use session.save(), yes, it returns me id class and i can reach all fields but except "id" .it returns null.


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.