Skip to content

Commit

Permalink
HHH-15776 Avoid type checking for ManagedEntity in StatefulPersistenc…
Browse files Browse the repository at this point in the history
…eContext#addReferenceEntry
  • Loading branch information
Sanne committed Nov 28, 2022
1 parent 7f0300d commit f78e48b
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@

import org.jboss.logging.Logger;

import static org.hibernate.engine.internal.ManagedTypeHelper.asManagedEntity;
import static org.hibernate.engine.internal.ManagedTypeHelper.asPersistentAttributeInterceptable;
import static org.hibernate.engine.internal.ManagedTypeHelper.isPersistentAttributeInterceptable;

Expand Down Expand Up @@ -573,9 +574,9 @@ public EntityEntry addEntry(
public void addReferenceEntry(
final Object entity,
final Status status) {

((ManagedEntity)entity).$$_hibernate_getEntityEntry().setStatus( status );
entityEntryContext.addEntityEntry( entity, ((ManagedEntity)entity).$$_hibernate_getEntityEntry() );
final EntityEntry entityEntry = asManagedEntity( entity ).$$_hibernate_getEntityEntry();
entityEntry.setStatus( status );
entityEntryContext.addEntityEntry( entity, entityEntry );

setHasNonReadOnlyEnties( status );
}
Expand Down

0 comments on commit f78e48b

Please sign in to comment.