HHH-15982 Fix bidirectional one-to-one detection for mappedBy side

This commit is contained in:
Marco Belladelli 2023-01-04 11:37:42 +01:00 committed by Christian Beikov
parent 5f08ffed83
commit 87ba85232f
2 changed files with 3 additions and 1 deletions

View File

@ -991,7 +991,8 @@ public class ToOneAttributeMapping
}
return false;
}
return parentNavigablePath.getLocalName().equals( bidirectionalAttributeName );
return parentNavigablePath.getLocalName().equals( bidirectionalAttributeName ) ||
parentNavigablePath.getLocalName().equals( identifyingColumnsTableExpression );
}
public String getBidirectionalAttributeName(){

View File

@ -47,6 +47,7 @@ public class EntitySelectFetchByUniqueKeyInitializer extends EntitySelectFetchIn
// make sure parentEntityInitializer.resolveInstance has been called before
parentEntityInitializer.resolveInstance( rowProcessingState );
if ( parentEntityInitializer.isInitialized() ) {
isInitialized = true;
return;
}
}