Package org.hibernate.engine

Examples of org.hibernate.engine.FetchStrategy


  protected FetchStrategy adjustJoinFetchIfNeeded(
      AssociationAttributeDefinition attributeDefinition,
      FetchStrategy fetchStrategy) {
    if ( currentDepth() > sessionFactory().getSettings().getMaximumFetchDepth() ) {
      return new FetchStrategy( fetchStrategy.getTiming(), FetchStyle.SELECT );
    }

    if ( attributeDefinition.getType().isCollectionType() && isTooManyCollections() ) {
      // todo : have this revert to batch or subselect fetching once "sql gen redesign" is in place
      return new FetchStrategy( fetchStrategy.getTiming(), FetchStyle.SELECT );
    }

    return fetchStrategy;
  }
View Full Code Here


    pushToStack( fetch );
    return true;
  }

  protected boolean handleAssociationAttribute(AssociationAttributeDefinition attributeDefinition) {
    final FetchStrategy fetchStrategy = determineFetchPlan( attributeDefinition );
    if ( fetchStrategy.getTiming() != FetchTiming.IMMEDIATE ) {
      return false;
    }

    final FetchOwner fetchOwner = currentFetchOwner();
    fetchOwner.validateFetchPlan( fetchStrategy );
View Full Code Here

          getType(),
          sessionFactory()
      );
    }

    return new FetchStrategy(
        Helper.determineFetchTiming( style, getType(), sessionFactory() ),
        style
    );
  }
View Full Code Here

    pushToStack( fetch );
    return true;
  }

  protected boolean handleAssociationAttribute(AssociationAttributeDefinition attributeDefinition) {
    final FetchStrategy fetchStrategy = determineFetchPlan( attributeDefinition );
    if ( fetchStrategy.getTiming() != FetchTiming.IMMEDIATE ) {
      return false;
    }

    final FetchOwner fetchOwner = currentFetchOwner();
    fetchOwner.validateFetchPlan( fetchStrategy );
View Full Code Here

                  throw new WalkingException( "A collection cannot be mapped to a composite ID sub-attribute." );
                }

                @Override
                public FetchStrategy determineFetchPlan(LoadQueryInfluencers loadQueryInfluencers, PropertyPath propertyPath) {
                  return new FetchStrategy( FetchTiming.IMMEDIATE, FetchStyle.JOIN );
                }

                @Override
                public CascadeStyle determineCascadeStyle() {
                  return CascadeStyles.NONE;
View Full Code Here

          getType(),
          sessionFactory()
      );
    }

    return new FetchStrategy(
        FetchStrategyHelper.determineFetchTiming( style, getType(), sessionFactory() ),
        style
    );
  }
View Full Code Here

          getSource().getType().getFetchMode( attributeNumber() ),
          getType()
      );
    }

    return new FetchStrategy( determineFetchTiming( style ), style );
  }
View Full Code Here

    }
  }

  @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;
  }
View Full Code Here

  protected FetchStrategy adjustJoinFetchIfNeeded(
      AssociationAttributeDefinition attributeDefinition,
      FetchStrategy fetchStrategy) {
    if ( lockMode.greaterThan( LockMode.READ ) ) {
      return new FetchStrategy( fetchStrategy.getTiming(), FetchStyle.SELECT );
    }

    final Integer maxFetchDepth = sessionFactory().getSettings().getMaximumFetchDepth();
    if ( maxFetchDepth != null && currentDepth() > maxFetchDepth ) {
      return new FetchStrategy( fetchStrategy.getTiming(), FetchStyle.SELECT );
    }

    if ( attributeDefinition.getType().isCollectionType() && isTooManyCollections() ) {
      // todo : have this revert to batch or subselect fetching once "sql gen redesign" is in place
      return new FetchStrategy( fetchStrategy.getTiming(), FetchStyle.SELECT );
    }

    return fetchStrategy;
  }
View Full Code Here

    return fetchedAssociationKeySourceMap.get( associationKey );
  }

  @Override
  public void foundCircularAssociation(AssociationAttributeDefinition attributeDefinition) {
    final FetchStrategy fetchStrategy = determineFetchStrategy( attributeDefinition );
    if ( fetchStrategy.getStyle() != FetchStyle.JOIN ) {
      return; // nothing to do
    }

    final AssociationKey associationKey = attributeDefinition.getAssociationKey();
View Full Code Here

TOP

Related Classes of org.hibernate.engine.FetchStrategy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.