From ca28c00c4125af17bb77d77162a4aae7d53e290b Mon Sep 17 00:00:00 2001 From: Sanne Grinovero Date: Thu, 3 Nov 2022 23:03:57 +0000 Subject: [PATCH] HHH-15662 ClasscastException caused by check for Managed rather than ManagedEntity --- .../org/hibernate/engine/internal/EntityEntryContext.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/engine/internal/EntityEntryContext.java b/hibernate-core/src/main/java/org/hibernate/engine/internal/EntityEntryContext.java index ec20eb3071c6..a532a17927d0 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/internal/EntityEntryContext.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/internal/EntityEntryContext.java @@ -92,7 +92,7 @@ public void addEntityEntry(Object entity, EntityEntry entityEntry) { ManagedEntity managedEntity = getAssociatedManagedEntity( entity ); final boolean alreadyAssociated = managedEntity != null; if ( !alreadyAssociated ) { - if ( ManagedTypeHelper.isManaged( entity ) ) { + if ( ManagedTypeHelper.isManagedEntity( entity ) ) { final ManagedEntity managed = ManagedTypeHelper.asManagedEntity( entity ); if ( entityEntry.getPersister().isMutable() ) { managedEntity = managed; @@ -152,7 +152,7 @@ public void addEntityEntry(Object entity, EntityEntry entityEntry) { } private ManagedEntity getAssociatedManagedEntity(Object entity) { - if ( ManagedTypeHelper.isManaged( entity ) ) { + if ( ManagedTypeHelper.isManagedEntity( entity ) ) { final ManagedEntity managedEntity = ManagedTypeHelper.asManagedEntity( entity ); if ( managedEntity.$$_hibernate_getEntityEntry() == null ) { // it is not associated