[JIRA] (HHH-16912) Hibernate 6.2 breaks backward compatibility
by Gavin King (JIRA)
Gavin King ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%... ) *commented* on HHH-16912 ( https://hibernate.atlassian.net/browse/HHH-16912?atlOrigin=eyJpIjoiMWFhYj... )
Re: Hibernate 6.2 breaks backward compatibility ( https://hibernate.atlassian.net/browse/HHH-16912?atlOrigin=eyJpIjoiMWFhYj... )
Rrrm, at first glance it looks like the main issue is not so much the changes to the mapping package, but rather that PostInsertIdentifierGenerator is now no longer an IdentifierGenerator.
That change was made to finally remove this awful decades-old hack:
public abstract class AbstractPostInsertGenerator
implements PostInsertIdentifierGenerator ... {
@Override
public Serializable generate(SharedSessionContractImplementor s, Object obj) {
return IdentifierGeneratorHelper.POST_INSERT_INDICATOR;
}
...
}
I don’t really see any obvious way to solve this in a completely backward-compatible way without simply putting back in that hack, and the incorrect inheritance of IdentifierGenerator by PostInsertIdentifierGenerator.
But what I could do, which I believe would fix the CCE, is return null if the cast would fail. That would probably make Liquibase work at least as well as before.
Now, on the other hand, on the Liquibase side, and please bear with me, because I don’t know anything about that code at all , but it appears that Liquibase only supports MultipleHiLoPerTableGenerator , which was completely removed in H6, and TableGenerator , and not SequenceStyleGenerator which is the usual type of table generation since a long time.
So I’m inclined to think that what really needs to change here is the Liquibase code, which according to my (possibly wrong) understanding is not properly up to date with H5, let alone H6.
( 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=EmailN... ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100232- sha1:304e1c7 )
2 years, 9 months