HHH-17019 EntityListener is not triggered for a LAZY loaded association

This commit is contained in:
Andrea Boriero 2023-08-02 15:04:09 +02:00 committed by Andrea Boriero
parent 1b1ed23964
commit 35a671e64e
1 changed files with 9 additions and 4 deletions

View File

@ -505,10 +505,15 @@ public abstract class AbstractEntityInitializer extends AbstractFetchParentAcces
final Object existingEntity = persistenceContext.getEntity( entityKey );
if ( existingEntity != null ) {
entityInstance = existingEntity;
if ( existingLoadingEntry == null && isExistingEntityInitialized( existingEntity ) ) {
this.isInitialized = true;
registerReloadedEntity( rowProcessingState, existingEntity );
notifyResolutionListeners( entityInstance );
if ( existingLoadingEntry == null ) {
if ( isExistingEntityInitialized( existingEntity ) ) {
this.isInitialized = true;
registerReloadedEntity( rowProcessingState, existingEntity );
notifyResolutionListeners( entityInstance );
}
else {
registerLoadingEntityInstanceFromExecutionContext( rowProcessingState, entityInstance );
}
}
}
else if ( entityInstanceFromExecutionContext != null ) {