HHH-15776 Avoid type checking for ManagedEntity in EntityEntryContext#deserialize as well
This commit is contained in:
parent
c882699557
commit
e4c294f4b6
|
@ -460,16 +460,17 @@ public class EntityEntryContext {
|
||||||
final ManagedEntity managedEntity;
|
final ManagedEntity managedEntity;
|
||||||
if ( isEnhanced ) {
|
if ( isEnhanced ) {
|
||||||
if ( entry.getPersister().isMutable() ) {
|
if ( entry.getPersister().isMutable() ) {
|
||||||
managedEntity = (ManagedEntity) entity;
|
managedEntity = ManagedTypeHelper.asManagedEntity( entity );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
managedEntity = new ImmutableManagedEntityHolder( (ManagedEntity) entity );
|
final ManagedEntity castedEntity = asManagedEntity( entity );
|
||||||
|
managedEntity = new ImmutableManagedEntityHolder( castedEntity );
|
||||||
if ( context.immutableManagedEntityXref == null ) {
|
if ( context.immutableManagedEntityXref == null ) {
|
||||||
context.immutableManagedEntityXref =
|
context.immutableManagedEntityXref =
|
||||||
new IdentityHashMap<>();
|
new IdentityHashMap<>();
|
||||||
}
|
}
|
||||||
context.immutableManagedEntityXref.put(
|
context.immutableManagedEntityXref.put(
|
||||||
(ManagedEntity) entity,
|
castedEntity,
|
||||||
(ImmutableManagedEntityHolder) managedEntity
|
(ImmutableManagedEntityHolder) managedEntity
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue