Two Laptop Bag*
The moose likes Object Relational Mapping and the fly likes Trying to save the object value without using Generation Strategy ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Trying to save the object value without using Generation Strategy ?" Watch "Trying to save the object value without using Generation Strategy ?" New topic
Author

Trying to save the object value without using Generation Strategy ?

Amandeep Singh
Ranch Hand

Joined: Jul 17, 2008
Posts: 844
My database is Oracle, and my id column value is an Oracle sequence, this sequence is executed by a trigger, so, before each row is inserted this trigger use this sequence to get the id value. So I am confused in which id strategy generation should I define in my entity class.

I defined like this-



Still the hibernate is throwing me error message-

Caused by org.hibernate.id.IdentifierGenerationException with message: "ids for this class must be manually assigned before calling save():


My intention is to skip hibernate validations. As I want to insert values using oracler trigger sequence.


SCJP 1.4, SCWCD 5, SCBCD 5, OCPJWSD 5,SCEA-1, Started Assignment Part 2
My blog- http://rkydesigns.blogspot.com
Amandeep Singh
Ranch Hand

Joined: Jul 17, 2008
Posts: 844
Any Idea Guys ?
 
Consider Paul's rocket mass heater.
 
subject: Trying to save the object value without using Generation Strategy ?
 
Similar Threads
JPA impl. w/Hibernate & Oracle PK Sequences/Triggers
Hibernate, id, oracle, sequence
Using select strategy (id generated by oracle trigger)
Insertion of objects with Sequences + Trigger
why my oracle sequence id increases by 2 when I use hibernate to insert