An example from migrating from H5 to H6 for Keycloak. This happens with Hibernate 6.2.CR4, and used to work with Hibernate 5:
* In Quarkus, the default is hibernate.order_updates is set to true in FastBootMetadataBuilder * Given updating two entities with a compsite key / IdClass which references its parent entity, it tries to compare the EntityKey, which fails in H6, but worked in H5 * On flush, the comparison fails with the exception shown below when Hibernate tries to sort the updates
There is a reproducer here: [https://github.com/ahus1/hibernate-test-case-templates/tree/is-HHH-xxxx-compare-not-implemented-for-entity-type|https://github.com/ahus1/hibernate-test-case-templates/tree/is-HHH-xxxx-compare-not-implemented-for-entity-type|smart-link]
Discussed on the Zulip chat here: [https://hibernate.zulipchat.com/#narrow/stream/132096-hibernate-user|https://hibernate.zulipchat.com/#narrow/stream/132096-hibernate-user]
Keycloak issue: [https://github.com/keycloak/keycloak/issues/19321|https://github.com/keycloak/keycloak/issues/19321|smart-link]
{noformat}java.lang.UnsupportedOperationException: compare() not implemented for EntityType
at org.hibernate.type.EntityType.compare(EntityType.java:255) at org.hibernate.type.ComponentType.compare(ComponentType.java:215) at org.hibernate.type.Type.compare(Type.java:222) at org.hibernate.action.internal.EntityAction.compareTo(EntityAction.java:160) at org.hibernate.action.internal.EntityAction.compareTo(EntityAction.java:28) at org.hibernate.engine.spi.ExecutableList.add(ExecutableList.java:225) at org.hibernate.engine.spi.ActionQueue.addAction(ActionQueue.java:311) at org.hibernate.engine.spi.ActionQueue.addAction(ActionQueue.java:353) at org.hibernate.event.internal.DefaultFlushEntityEventListener.scheduleUpdate(DefaultFlushEntityEventListener.java:252) at org.hibernate.event.internal.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:143) at org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:127) at org.hibernate.event.internal.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:221) at org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:90) at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:38) at org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:127) at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1412) at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1398) at org.hibernate.bugs.ORMUnitTestCase.hhh123Test(ORMUnitTestCase.java:115){noformat} |
|