Opening book details…
Can I read Retrieve Auto-Increment Key in Hibernate on EtoBox?
Retrieve Auto-Increment Key in Hibernate by whitefeather_swing is a document available to read on EtoBox.
What is Retrieve Auto-Increment Key in Hibernate about?
When inserting a new row into a MySQL table with an auto-increment primary key using Hibernate, the primary key value will be populated on the entity object after it is saved and the session is flushed. You can call getId() on the entity object to retrieve the auto-generated primary key value. For portability, using a sequence generator is recommended as it allows retrieving the ID before the object is persisted.
- Author
- whitefeather_swing
- Language
- EN