Bert Roos (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiZTI2NmJjMzM0...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16912?atlOrigin=eyJpIjoiZTI2Nm...
) HHH-16912 (
https://hibernate.atlassian.net/browse/HHH-16912?atlOrigin=eyJpIjoiZTI2Nm...
) Hibernate 6.2 breaks backward compatibility (
https://hibernate.atlassian.net/browse/HHH-16912?atlOrigin=eyJpIjoiZTI2Nm...
)
Issue Type: Bug Affects Versions: 6.2.0, 6.2.1, 6.2.2, 6.2.3, 6.2.4, 6.2.5, 6.2.6
Assignee: Unassigned Components: hibernate-core Created: 08/Jul/2023 07:57 AM Environment:
Hibernate 6.2.6 on Java 17 Priority: Blocker Reporter: Bert Roos (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
As part of
https://hibernate.atlassian.net/browse/HHH-15782 , the generator hierarchy is
updated. This lead to the deprecation of
org.hibernate.mapping.KeyValue.createIdentifierGenerator. To retain backward
compatibility, this method was kept in the code, calling the new method ( createGenerator
) and casting the result to IdentifierGenerator. That however does not work, as the new
method returns an instance of type IdentityGenerator , which cannot be cast to
IdentifierGenerator.
This makes Liquibase Hibernate fail with the following error:
[2023-07-08 16:54:17] SEVERE [liquibase.integration] class
org.hibernate.id.IdentityGenerator cannot be cast to class
org.hibernate.id.IdentifierGenerator (org.hibernate.id.IdentityGenerator and
org.hibernate.id.IdentifierGenerator are in unnamed module of loader 'app')
liquibase.exception.CommandExecutionException: java.lang.ClassCastException: class
org.hibernate.id.IdentityGenerator cannot be cast to class
org.hibernate.id.IdentifierGenerator (org.hibernate.id.IdentityGenerator and
org.hibernate.id.IdentifierGenerator are in unnamed module of loader 'app')
at liquibase.command.CommandScope.execute(CommandScope.java:236)
at liquibase.integration.commandline.CommandRunner.call(CommandRunner.java:55)
at liquibase.integration.commandline.CommandRunner.call(CommandRunner.java:24)
at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
at picocli.CommandLine.access$1500(CommandLine.java:148)
at
picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
at picocli.CommandLine.execute(CommandLine.java:2170)
at
liquibase.integration.commandline.LiquibaseCommandLine.lambda$execute$2(LiquibaseCommandLine.java:381)
at liquibase.Scope.child(Scope.java:206)
at liquibase.Scope.child(Scope.java:182)
at
liquibase.integration.commandline.LiquibaseCommandLine.lambda$execute$3(LiquibaseCommandLine.java:356)
at liquibase.Scope.child(Scope.java:206)
at liquibase.Scope.child(Scope.java:182)
at
liquibase.integration.commandline.LiquibaseCommandLine.execute(LiquibaseCommandLine.java:354)
at
liquibase.integration.commandline.LiquibaseCommandLine.main(LiquibaseCommandLine.java:94)
Caused by: java.lang.ClassCastException: class org.hibernate.id.IdentityGenerator cannot
be cast to class org.hibernate.id.IdentifierGenerator (org.hibernate.id.IdentityGenerator
and org.hibernate.id.IdentifierGenerator are in unnamed module of loader 'app')
at org.hibernate.mapping.KeyValue.createIdentifierGenerator(KeyValue.java:58)
at
liquibase.ext.hibernate.snapshot.TableSnapshotGenerator.addTo(TableSnapshotGenerator.java:84)
at
liquibase.ext.hibernate.snapshot.HibernateSnapshotGenerator.snapshot(HibernateSnapshotGenerator.java:82)
at
liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:49)
at
liquibase.ext.hibernate.snapshot.HibernateSnapshotGenerator.snapshot(HibernateSnapshotGenerator.java:74)
at
liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:49)
at liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:313)
at liquibase.snapshot.DatabaseSnapshot.init(DatabaseSnapshot.java:106)
at liquibase.snapshot.DatabaseSnapshot.<init>(DatabaseSnapshot.java:59)
at
liquibase.snapshot.JdbcDatabaseSnapshot.<init>(JdbcDatabaseSnapshot.java:34)
at
liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:214)
at
liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:187)
at
liquibase.command.core.DiffCommandStep.generateDatabaseShapshot(DiffCommandStep.java:205)
at
liquibase.command.core.DiffCommandStep.createReferenceSnapshot(DiffCommandStep.java:192)
at
liquibase.command.core.DiffCommandStep.createDiffResult(DiffCommandStep.java:113)
at liquibase.command.core.DiffCommandStep.run(DiffCommandStep.java:89)
at liquibase.command.CommandScope.execute(CommandScope.java:213)
... 18 more
See related Liquibase ticket: liquibase/liquibase-hibernate#495 (
https://github.com/liquibase/liquibase-hibernate/issues/495 )
(
https://hibernate.atlassian.net/browse/HHH-16912#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16912#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#100230- sha1:acc9c6f )