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?
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.
Source: https://vcfvct.wordpress.com/2016/04/23/jpa-sequencegenerator-with-allocationsize-1-performance-tuning/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With