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.
1 - native 2 - sequence (oracle sequence name, or let hibernate do it?)
posted 8 years ago
Here's something you could try. The id value is being inserted by the trigger for you so in my opinion you do not have to specify andy Generation strategy for your Id column. I suggest you set the updateable=false and insertable=false for the id column. You should be able to specify that either in the xml file or using @Column annotation.