HHH-16960 OneToOne lazy loading fails when fetch graph is involved
This commit is contained in:
parent
b813d9b652
commit
7e0cdf5d06
|
@ -1630,9 +1630,12 @@ public class ToOneAttributeMapping
|
||||||
final boolean selectByUniqueKey = isSelectByUniqueKey( side );
|
final boolean selectByUniqueKey = isSelectByUniqueKey( side );
|
||||||
|
|
||||||
// Consider all associations annotated with @NotFound as EAGER
|
// Consider all associations annotated with @NotFound as EAGER
|
||||||
|
// and LAZY one-to-one that are not instrumented and not optional
|
||||||
if ( fetchTiming == FetchTiming.IMMEDIATE
|
if ( fetchTiming == FetchTiming.IMMEDIATE
|
||||||
|| hasNotFoundAction()
|
|| hasNotFoundAction()
|
||||||
|| getAssociatedEntityMappingType().getSoftDeleteMapping() != null ) {
|
|| getAssociatedEntityMappingType().getSoftDeleteMapping() != null
|
||||||
|
|| ( !entityMappingType.getEntityPersister().isInstrumented()
|
||||||
|
&& cardinality == Cardinality.ONE_TO_ONE && isOptional ) ) {
|
||||||
return buildEntityFetchSelect(
|
return buildEntityFetchSelect(
|
||||||
fetchParent,
|
fetchParent,
|
||||||
this,
|
this,
|
||||||
|
|
Loading…
Reference in New Issue