Hibernate generates entity identities in an inconsistent order in case `allocationSize = 1` property is not set for `@SequenceGenerator`. As per logs, identities are generated in following sequence 1, 2, -46, -45, -44 and so on.
Same behaviour is reproducible when `@SequenceGenerator` annotation is altogether missing.
However, as noticed, this issue can is visible when schema is generated by manual script and not by hibernate itself. [^ hibernate create . log sql ] [^ drop.sql]
PF attached [^ hibernate-issues.zip] Hibernate ORM since version sample project to reproduce the issue (Database properties in persistence.xml need to changed for target environment).
Also see generated log [^hibernate.log]. |
|