Reputation: 29537
New to Spring Boot/JPA/Hibernate and I'm trying to understand what the hibernate.id.new_generator_mappings
property actually does.
According to that doc, it:
"...directs how identity or sequence columns are generated when using @GeneratedValue"
But it doesn't really explain the behavioral difference from when its true
vs when its false
. Any ideas?
Upvotes: 27
Views: 23520
Reputation: 339
This ‘hibernate.id.new_generator_mappings’ by default is false which uses the ‘SequenceHiLoGenerator‘ which will have that multiply behavior. Once we set it to true, it will then use the ‘SequenceStyleGenerator‘, which is more jpa and oracle friendly. It generates identifier values based on an sequence-style database structure. Variations range from actually using a sequence to using a table to mimic a sequence.
Upvotes: 14