• Post Reply Bookmark Topic Watch Topic
  • New Topic

Assigned id generator and Save Method

 
Patricia Samuel
Ranch Hand
Posts: 300
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

While going through the book " Hibernate Quickly", i got confused with this statement -

Keep in mind that Hibernate
doesn’t set the ID value if the generator type is assigned.)


What i deduced that when the generator type is Assigned, we won't get id value of that object. Please confirm me whether i understood it well or not and along with why is it that we don't get Id value in case of assigned generator.

Thanks a lot.
~Patricia.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you use a generation strategy of "assigned" you need to assign the id yourself.
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!