IT Support (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiZjBhNDFmYjNm...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-13939?atlOrigin=eyJpIjoiZjBhND...
) HHH-13939 (
https://hibernate.atlassian.net/browse/HHH-13939?atlOrigin=eyJpIjoiZjBhND...
) H2Dialect @GeneratedValue regression on schema generation, uses sequence instead of
generated by default as identity (
https://hibernate.atlassian.net/browse/HHH-13939?atlOrigin=eyJpIjoiZjBhND...
)
Issue Type: Bug Affects Versions: 5.0.0.Final, 5.4.13 Assignee: IT Support (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) Components: hibernate-jpamodelgen Created: 07/Apr/2020 13:40 PM Environment: Java 7,
Java 8, h2-1.4.200.jar Labels: documentation regression Priority: Major Reporter: IT
Support (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
In Hibernate 4.x, specifically 4.3.11
*persistence.xml snippet*
<property name= "hibernate.dialect" value=
"org.hibernate.dialect.H2Dialect" />
<property name= "hibernate.hbm2ddl.auto" value= "create-drop"
/>
<property name= "javax.persistence.jdbc.url" value=
"jdbc:h2:mem:unittests" />
*4.x generated SQL*
Hibernate: create table dbo.office (officeid bigint generated by default as identity ,
office varchar (255) not null , description varchar (255), sequence varchar (255), orgid
bigint not null , primary key (officeid))
*5.x generated SQL*
create table dbo.office (officeid bigint not null , office varchar (255) not null ,
description varchar (255), sequence varchar (255), orgid bigint not null , primary key
(officeid))
create sequence hibernate_sequence start with 1 increment by 1
I have confirmed the dialect values are sensible. The error seems to be inside / around
the SessionFactoryImpl's identifierGenerators. While the dialect indicates Identity
generation, the generator seems to be a result of DefaultIdentifierGeneratorFactory, which
produces sequence based ids.
Specifically the metadata.getEntityBindings() returns a PersistentClass model where the
identifier is a SimpleValue whose identifierGenerator is a SequenceStyleGenerator
This can be backtracked to:
*EntityManagerFactoryBuilderImpl*
private MetadataImplementor metadata() {
if ( this.metadata == null ) {
this.metadata = MetadataBuildingProcess.complete( managedResources,
metamodelBuilder.getMetadataBuildingOptions() );
}
return metadata;
}
This is not related to:
* HHH-13727 (
https://hibernate.atlassian.net/browse/HHH-13727 ) Closed
* HHH-13597 (
https://hibernate.atlassian.net/browse/HHH-13597 ) Closed
(
https://hibernate.atlassian.net/browse/HHH-13939#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-13939#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100124- sha1:c13ca0d )