HHH-13756 rename 'NavigateResult' class name to 'Navigation'

This commit is contained in:
Nathan Xu 2020-03-11 11:24:22 -04:00 committed by Steve Ebersole
parent 335c1ecd75
commit 94b8d8a128
4 changed files with 22 additions and 22 deletions

View File

@ -427,14 +427,14 @@ public class LoaderSelectBuilder {
FetchTiming fetchTiming = fetchable.getMappedFetchStrategy().getTiming(); FetchTiming fetchTiming = fetchable.getMappedFetchStrategy().getTiming();
boolean joined = fetchable.getMappedFetchStrategy().getStyle() == FetchStyle.JOIN; boolean joined = fetchable.getMappedFetchStrategy().getStyle() == FetchStyle.JOIN;
EntityGraphNavigator.NavigateResult navigateResult = null; EntityGraphNavigator.Navigation navigation = null;
// 'entity graph' takes precedence over 'fetch profile' // 'entity graph' takes precedence over 'fetch profile'
if ( entityGraphNavigator != null) { if ( entityGraphNavigator != null) {
navigateResult = entityGraphNavigator.navigateIfApplicable( fetchParent, fetchable, isKeyFetchable ); navigation = entityGraphNavigator.navigateIfApplicable( fetchParent, fetchable, isKeyFetchable );
if ( navigateResult != null ) { if ( navigation != null ) {
fetchTiming = navigateResult.getFetchStrategy(); fetchTiming = navigation.getFetchStrategy();
joined = navigateResult.isJoined(); joined = navigation.isJoined();
} }
} }
else if ( loadQueryInfluencers.hasEnabledFetchProfiles() ) { else if ( loadQueryInfluencers.hasEnabledFetchProfiles() ) {
@ -493,8 +493,8 @@ public class LoaderSelectBuilder {
if ( !( fetchable instanceof BasicValuedModelPart ) ) { if ( !( fetchable instanceof BasicValuedModelPart ) ) {
fetchDepth--; fetchDepth--;
} }
if ( entityGraphNavigator != null && navigateResult != null ) { if ( entityGraphNavigator != null && navigation != null ) {
entityGraphNavigator.backtrack( navigateResult.getPreviousContext() ); entityGraphNavigator.backtrack( navigation.getPreviousContext() );
} }
} }
}; };

View File

@ -87,6 +87,8 @@ public class StandardSqmSelectTranslator
private final EntityGraphNavigator entityGraphNavigator; private final EntityGraphNavigator entityGraphNavigator;
private int fetchDepth;
public StandardSqmSelectTranslator( public StandardSqmSelectTranslator(
QueryOptions queryOptions, QueryOptions queryOptions,
DomainParameterXref domainParameterXref, DomainParameterXref domainParameterXref,
@ -230,8 +232,6 @@ public class StandardSqmSelectTranslator
return getFromClauseIndex().findTableGroup( navigablePath ).getModelPart(); return getFromClauseIndex().findTableGroup( navigablePath ).getModelPart();
} }
private int fetchDepth = 0;
@Override @Override
public List<Fetch> visitFetches(FetchParent fetchParent) { public List<Fetch> visitFetches(FetchParent fetchParent) {
final List<Fetch> fetches = CollectionHelper.arrayList( fetchParent.getReferencedMappingType().getNumberOfFetchables() ); final List<Fetch> fetches = CollectionHelper.arrayList( fetchParent.getReferencedMappingType().getNumberOfFetchables() );
@ -284,7 +284,7 @@ public class StandardSqmSelectTranslator
FetchTiming fetchTiming = fetchable.getMappedFetchStrategy().getTiming(); FetchTiming fetchTiming = fetchable.getMappedFetchStrategy().getTiming();
boolean joined = false; boolean joined = false;
EntityGraphNavigator.NavigateResult navigateResult = null; EntityGraphNavigator.Navigation navigation = null;
final SqmAttributeJoin fetchedJoin = getFromClauseIndex().findFetchedJoinByPath( fetchablePath ); final SqmAttributeJoin fetchedJoin = getFromClauseIndex().findFetchedJoinByPath( fetchablePath );
@ -307,10 +307,10 @@ public class StandardSqmSelectTranslator
alias = null; alias = null;
if ( entityGraphNavigator != null ) { if ( entityGraphNavigator != null ) {
navigateResult = entityGraphNavigator.navigateIfApplicable( fetchParent, fetchable, isKeyFetchable ); navigation = entityGraphNavigator.navigateIfApplicable( fetchParent, fetchable, isKeyFetchable );
if ( navigateResult != null ) { if ( navigation != null ) {
fetchTiming = navigateResult.getFetchStrategy(); fetchTiming = navigation.getFetchStrategy();
joined = navigateResult.isJoined(); joined = navigation.isJoined();
} }
} }
else if ( fetchInfluencers.hasEnabledFetchProfiles() ) { else if ( fetchInfluencers.hasEnabledFetchProfiles() ) {
@ -418,8 +418,8 @@ public class StandardSqmSelectTranslator
); );
} }
finally { finally {
if ( entityGraphNavigator != null && navigateResult != null ) { if ( entityGraphNavigator != null && navigation != null ) {
entityGraphNavigator.backtrack( navigateResult.getPreviousContext() ); entityGraphNavigator.backtrack( navigation.getPreviousContext() );
} }
} }
} }

View File

@ -22,13 +22,13 @@ public interface EntityGraphNavigator {
* <li>whether the new graph node fetching is joined</li> * <li>whether the new graph node fetching is joined</li>
* </ul> * </ul>
*/ */
class NavigateResult { class Navigation {
private GraphImplementor previousContext; private GraphImplementor previousContext;
private FetchTiming fetchTiming; private FetchTiming fetchTiming;
private boolean joined; private boolean joined;
public NavigateResult(GraphImplementor previousContext, FetchTiming fetchTiming, boolean joined) { public Navigation(GraphImplementor previousContext, FetchTiming fetchTiming, boolean joined) {
this.previousContext = previousContext; this.previousContext = previousContext;
this.fetchTiming = fetchTiming; this.fetchTiming = fetchTiming;
this.joined = joined; this.joined = joined;
@ -64,7 +64,7 @@ public interface EntityGraphNavigator {
* @param parent The FetchParent * @param parent The FetchParent
* @param fetchable The Fetchable * @param fetchable The Fetchable
* @param exploreKeySubgraph true if only key sub graph is explored; false if key sub graph is excluded * @param exploreKeySubgraph true if only key sub graph is explored; false if key sub graph is excluded
* @return {@link NavigateResult} if applicable; null otherwise * @return {@link Navigation} if applicable; null otherwise
*/ */
NavigateResult navigateIfApplicable(FetchParent parent, Fetchable fetchable, boolean exploreKeySubgraph); Navigation navigateIfApplicable(FetchParent parent, Fetchable fetchable, boolean exploreKeySubgraph);
} }

View File

@ -47,7 +47,7 @@ public class StandardEntityGraphNavigatorImpl implements EntityGraphNavigator {
} }
@Override @Override
public NavigateResult navigateIfApplicable(FetchParent fetchParent, Fetchable fetchable, boolean exploreKeySubgraph) { public Navigation navigateIfApplicable(FetchParent fetchParent, Fetchable fetchable, boolean exploreKeySubgraph) {
final GraphImplementor previousContextRoot = currentGraphContext; final GraphImplementor previousContextRoot = currentGraphContext;
FetchTiming fetchTiming = null; FetchTiming fetchTiming = null;
boolean joined = false; boolean joined = false;
@ -97,7 +97,7 @@ public class StandardEntityGraphNavigatorImpl implements EntityGraphNavigator {
joined = fetchable.getMappedFetchStrategy().getStyle() == FetchStyle.JOIN; joined = fetchable.getMappedFetchStrategy().getStyle() == FetchStyle.JOIN;
} }
} }
return new NavigateResult( previousContextRoot, fetchTiming, joined ); return new Navigation( previousContextRoot, fetchTiming, joined );
} }
private boolean appliesTo(FetchParent fetchParent) { private boolean appliesTo(FetchParent fetchParent) {