Will Herrmann (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiOGRiZTQ1ZTRi...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-17009?atlOrigin=eyJpIjoiOGRiZT...
) HHH-17009 (
https://hibernate.atlassian.net/browse/HHH-17009?atlOrigin=eyJpIjoiOGRiZT...
) Hibernate 6.2 migration guide does explain how to deal with removal of
AbstractPostInsertGenerator (affects IdentityGenerator) (
https://hibernate.atlassian.net/browse/HHH-17009?atlOrigin=eyJpIjoiOGRiZT...
)
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, 6.2.7
Assignee: Unassigned Components: documentation Created: 27/Jul/2023 17:36 PM Priority:
Major Reporter: Will Herrmann (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
The Hibernate 6.2 Migration Guide (
https://docs.jboss.org/hibernate/orm/6.2/migration-guide/migration-guide.... ) describes
changes between 6.1.x and 6.2.x. However, it does not provide any information about how to
deal with the removal of AbstractPostInsertGenerator ( Hibernate 6.1 Javadoc (
https://docs.jboss.org/hibernate/orm/6.1/javadocs/org/hibernate/id/Abstra...
) ).
Because the removal is not documented, users are unable to determine how to migrate their
projects that are using it.
This also impacts IdentityGenerator , which no longer has AbstractPostInsertGenerator as a
superclass and thus does not inherit implementations of the methods
determineBulkInsertionIdentifierGenerationSelectFragment() , generate() , and
supportsBulkInsertionIdentifierGeneration() (see 6.1 Javadocs (
https://docs.jboss.org/hibernate/orm/6.1/javadocs/org/hibernate/id/Identi...
) and 6.2 Javadocs (
https://docs.jboss.org/hibernate/orm/6.2/javadocs/org/hibernate/id/Identi...
) ).
Example of Impact
-----------------
IdentityGenerator no longer has an implementation of generate() because it no longer
inherits from AbstractPostInsertGenerator. In our project, we have code like this:
public class FooIdentityGenerator extends IdentityGenerator {
@Override
public Object generate(SharedSessionContractImplementor s, Object obj) {
if (...) {
return ...;
} else {
return super.generate(implementor, obj);
}
}
}
Because IdentityGenerator no longer has an implementation of generate() , the @Override
and the super.generate() are both broken.
Without anything in the Migration Guide on how to mitigate this, we are unsure how to fix
our project so we can upgrade to Hibernate 6.2.
Additional Notes
----------------
AbstractPostInsertGenerator was not deprecated, was not on the internals list (
https://docs.jboss.org/hibernate/orm/6.1/internals/internal.txt ) , and was not on the
incubating list (
https://docs.jboss.org/hibernate/orm/6.1/incubating/incubating.txt ).
Therefore, it is both surprising that it was removed, and noteworthy that it is not on the
migration guide.
(
https://hibernate.atlassian.net/browse/HHH-17009#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-17009#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#100233- sha1:98e4b22 )