I am using DB2 GENERATED IDENTITY
to auto-increment value for a column. The column is not a primary key column. I am not sure how to configure the field in the hibernate mapping class.
Please help.
Asked
Active
Viewed 1,959 times
1 Answers
1
Use the @Generated annotation, and make sure to mark the property as non insertable, adn non updatable, as explained in the Hibernate documentation.
Note that this will force Hibernate to issue an additional select query after each insert and update query.

JB Nizet
- 678,734
- 91
- 1,224
- 1,255