mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-08 12:14:47 +00:00
HHH-17224 Respect association fetch style for dynamic results
This commit is contained in:
parent
c29869ec7b
commit
50a83ba953
@ -1890,10 +1890,9 @@ private ImmutableFetchList fetchProcessor(FetchParent fetchParent, LoaderSqlAstC
|
||||
final Fetchable fetchable = fetchableContainer.getFetchable( i );
|
||||
// Ignore plural attributes
|
||||
if ( !( fetchable instanceof PluralAttributeMapping ) ) {
|
||||
final FetchTiming fetchTiming;
|
||||
final FetchTiming fetchTiming = fetchable.getMappedFetchOptions().getTiming();
|
||||
if ( fetchable instanceof BasicValuedModelPart ) {
|
||||
// Ignore lazy basic columns
|
||||
fetchTiming = fetchable.getMappedFetchOptions().getTiming();
|
||||
if ( fetchTiming == FetchTiming.DELAYED ) {
|
||||
continue;
|
||||
}
|
||||
@ -1908,10 +1907,6 @@ else if ( fetchable instanceof Association ) {
|
||||
if ( !getRootTableName().equals( association.getForeignKeyDescriptor().getKeyTable() ) ) {
|
||||
continue;
|
||||
}
|
||||
fetchTiming = FetchTiming.DELAYED;
|
||||
}
|
||||
else {
|
||||
fetchTiming = fetchable.getMappedFetchOptions().getTiming();
|
||||
}
|
||||
|
||||
if ( fetchTiming == null ) {
|
||||
@ -1923,7 +1918,7 @@ else if ( fetchable instanceof Association ) {
|
||||
fetchable,
|
||||
fetchParent.resolveNavigablePath( fetchable ),
|
||||
fetchTiming,
|
||||
true,
|
||||
false,
|
||||
null,
|
||||
creationState
|
||||
);
|
||||
|
@ -142,7 +142,7 @@ else if ( attributeMapping instanceof ToOneAttributeMapping ) {
|
||||
return parent.generateFetchableFetch(
|
||||
attributeMapping,
|
||||
fetchPath,
|
||||
FetchTiming.DELAYED,
|
||||
attributeMapping.getMappedFetchOptions().getTiming(),
|
||||
false,
|
||||
null,
|
||||
creationStateImpl
|
||||
@ -165,7 +165,7 @@ else if ( attributeMapping instanceof ToOneAttributeMapping ) {
|
||||
return parent.generateFetchableFetch(
|
||||
attributeMapping,
|
||||
fetchPath,
|
||||
FetchTiming.DELAYED,
|
||||
attributeMapping.getMappedFetchOptions().getTiming(),
|
||||
false,
|
||||
null,
|
||||
creationStateImpl
|
||||
|
Loading…
x
Reference in New Issue
Block a user