| First a few notes about the JPA @SequenceGenerator:
- The annotation defines a default value of 1 for initialValue. initialValue==1 indicates "STARTS WITH 1" and Hibernate assumes that is the first value it will get.
- The annotation defines a default value of 50 for incrementSize. initialValue==50 indicates "INCREMENT BY 50", so Hibernate assumes each successive call to the database sequence gets incrementing values as defined by that value.
I believe that this is just a case of bad configuration. If you are upgrading to 5.0 perhaps you just missed the migration guide point about sequence optimizers? https://github.com/hibernate/hibernate-orm/blob/5.0/migration-guide.adoc#changed-setting-defaults If so try setting hibernate.id.new_generator_mappings to false as mentioned. I'd have to think this is close to the problem because your sequence is clearly not incrementing by 50. |