-->
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: Retrieving UUID after it has been created
PostPosted: Wed Aug 20, 2008 12:16 pm 
Newbie

Joined: Fri Feb 22, 2008 2:45 am
Posts: 1
Hi, lets say I have a class name TV.

The TV class has a "TV_ID" which is a Hex.UUID generated by nhibernate and a property name "Size".

and I have a loop that goes like this:

for(int = 0;i < array.length;i++)
{
TV.Size = array[i]
session.Save(TV);
}
tx.commit();

Is there a way to get the UUID generated by nhibernate without using a query to the table to look for it?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 21, 2008 1:47 am 
Regular
Regular

Joined: Tue Jul 29, 2008 3:30 am
Posts: 74
I have never used that generator myself but as far as I know NHibernate should fill your id-property when you call session.Save().


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.