KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have the following definition for an id field in an entity that is mapped to a table in HSQLDB. ... @Id @GeneratedValue(strategy=GenerationType.AUTO) @Column(name = "ID") private Integer id; ... But this does not seem to generate the an unique id; instead an attempt is made to insert null into the column which results in failure. If, I manually create a sequence and generation strategy to use that sequence then the data is persisted as expected. Doesn't a generation strategy of auto imply that the provider (hibernate in this case) will automatically choose the correct approach and do all the heavy lifting as needed (create sequence, use a native approach or whatever works for that particular platform)? Is my understanding incorrect?
Tags (comma-separated)
Save Edits
Cancel