-->
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: use of <generator class="assigned"/> in hibe
PostPosted: Wed Apr 19, 2006 1:09 am 
Newbie

Joined: Wed Apr 19, 2006 12:57 am
Posts: 2
Hi all

In Hibernate mapping file (.hbm.xml), we are mapping the table using
<hibernate-mapping>
<class name="roseindia.tutorial.hibernate.Contact" table="CONTACT">
<id name="id" type="long" column="ID" >
<generator class="assigned"/>
</id>

My doubt is what is the usage of giving generator class="assigned" here.

please help me....

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 19, 2006 6:59 am 
Regular
Regular

Joined: Tue Jan 03, 2006 9:52 am
Posts: 52
Location: Zurich
If you use "assigned", then the application must set the id before saving the object by calling the setter method manually. If this is not your intention and this is not a natural key, you probably want to use "native" instead.

Hope this helps!
Urs


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 20, 2006 2:54 am 
Newbie

Joined: Wed Apr 19, 2006 12:57 am
Posts: 2
Yes your information is useful for me.
Thank you...


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.