Originally posted by Chris Hendy:
Either remove your setting of the id in hibernate and let the database trigger handle it under all circumstances.
Or change the trigger to get the next_val from the sequence and assign it to the column only if :new.ID IS NULL
Hello there,
I have got a similar problem, this database can't be touched, Oracle, so they have sequences for each id. And I am doing reverse engineering, so I at first I did:
But in the documentation says that I should use only these options:
AUTO - either identity column, sequence or table depending on the underlying DB
TABLE - table holding the id
IDENTITY - identity column
SEQUENCE - sequence
And I heard something about using "native" also. Now I am confused, what I need is let the database take care of my table ID, hibernate shouldn't care about it. Which option?
Thanks!