HHH-16970 Fix owner access for eager collection initializer

This commit is contained in:
Marco Belladelli 2023-08-08 12:53:41 +02:00 committed by Christian Beikov
parent 3bb20da9d1
commit d78681eaa2
1 changed files with 5 additions and 2 deletions

View File

@ -212,8 +212,11 @@ public abstract class AbstractImmediateCollectionInitializer extends AbstractCol
);
}
if ( getParentAccess() != null ) {
getParentAccess().registerResolutionListener(
final FetchParentAccess entityParentAccess = getParentAccess() != null ?
getParentAccess().findFirstEntityDescriptorAccess() :
null;
if ( entityParentAccess != null ) {
entityParentAccess.registerResolutionListener(
owner -> collectionInstance.setOwner( owner )
);
}