-->
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: genarator class
PostPosted: Wed Feb 06, 2008 1:11 am 
Newbie

Joined: Tue Feb 05, 2008 6:24 am
Posts: 3
when to use
Code:
<generator class="assigned" />

and when to use
Code:
<generator class="native" />


Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 06, 2008 3:37 am 
Newbie

Joined: Wed Feb 06, 2008 2:28 am
Posts: 2
For the 1st one if you wish to assign the Primary Key manually.
Now the setId method should ot private.

For the 2nd one ,if you are using this Application in multiple DB, we can just specify native, now Hibernate select a startergy for generating PK based on the underlying DB.
Ex if you are using ORACLE , Hibernate will select "Sequence" and create a Sequence like "Hibernate_Sequence".

Kathir


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.