public static boolean isJoinFetched(FetchStrategy fetchStrategy) { return fetchStrategy.getTiming() == FetchTiming.IMMEDIATE && fetchStrategy.getStyle() == FetchStyle.JOIN; } }
public boolean shouldIncludeJoin(FetchStrategy fetchStrategy) { return fetchStrategy.getTiming() == FetchTiming.IMMEDIATE && fetchStrategy.getStyle() == FetchStyle.JOIN; } }
public void processingFetch(Fetch fetch) { if ( ! hasSubselectFetch ) { if ( fetch.getFetchStrategy().getStyle() == FetchStyle.SUBSELECT && fetch.getFetchStrategy().getTiming() != FetchTiming.IMMEDIATE ) { hasSubselectFetch = true; } } if ( isJoinFetchedBag( fetch ) ) { if ( joinedBagAttributeFetches == null ) { joinedBagAttributeFetches = new HashSet<>(); } joinedBagAttributeFetches.add( (CollectionAttributeFetch) fetch ); } }
@Override protected FetchStrategy resolveImplicitFetchStrategyFromEntityGraph( final AssociationAttributeDefinition attributeDefinition) { FetchStrategy fetchStrategy = attributeDefinition.determineFetchPlan( loadQueryInfluencers, currentPropertyPath ); if ( fetchStrategy.getTiming() == FetchTiming.IMMEDIATE && fetchStrategy.getStyle() == FetchStyle.JOIN ) { // see if we need to alter the join fetch to another form for any reason fetchStrategy = adjustJoinFetchIfNeeded( attributeDefinition, fetchStrategy ); } return fetchStrategy; }
@Override protected FetchStrategy determineFetchStrategy(AssociationAttributeDefinition attributeDefinition) { FetchStrategy fetchStrategy = attributeDefinition.determineFetchPlan( loadQueryInfluencers, currentPropertyPath ); if ( fetchStrategy.getTiming() == FetchTiming.IMMEDIATE && fetchStrategy.getStyle() == FetchStyle.JOIN ) { // see if we need to alter the join fetch to another form for any reason fetchStrategy = adjustJoinFetchIfNeeded( attributeDefinition, fetchStrategy ); } return fetchStrategy; }
@Override public void foundCircularAssociation(AssociationAttributeDefinition attributeDefinition) { final FetchStrategy fetchStrategy = determineFetchStrategy( attributeDefinition ); if ( fetchStrategy.getStyle() != FetchStyle.JOIN ) { return; // nothing to do } // Bi-directional association & the owning side was already visited. If the current attribute node refers // to it, fetch. // ENTITY nature handled by super. final GraphImplementor currentGraph = graphStack.getCurrent(); if ( attributeDefinition.getAssociationNature() == AssociationAttributeDefinition.AssociationNature.COLLECTION && currentGraph != null && currentGraph.findAttributeNode( attributeDefinition.getName() ) != null ) { currentSource().buildCollectionAttributeFetch( attributeDefinition, fetchStrategy ); } super.foundCircularAssociation( attributeDefinition ); } }
boolean joined = fetchable.getMappedFetchStrategy().getStyle() == FetchStyle.JOIN;
joined = fetchTiming == FetchTiming.IMMEDIATE && fetchable.getMappedFetchStrategy().getStyle() == FetchStyle.JOIN; alias = null;