Package org.hibernate.loader.plan.spi

Examples of org.hibernate.loader.plan.spi.LoadPlan


            buildingParameters.getLockMode() != null
                ? buildingParameters.getLockMode()
                : buildingParameters.getLockOptions().getLockMode()
    );

    final LoadPlan plan = MetamodelDrivenLoadPlanBuilder.buildRootCollectionLoadPlan( strategy, collectionPersister );
    this.staticLoadQuery = BatchingLoadQueryDetailsFactory.makeCollectionLoadQueryDetails(
        collectionPersister,
        plan,
        buildingParameters
    );
View Full Code Here


      strategy = new FetchStyleLoadPlanBuildingAssociationVisitationStrategy(
          factory, buildingParameters.getQueryInfluencers(),buildingParameters.getLockMode()
      );
    }

    final LoadPlan plan = MetamodelDrivenLoadPlanBuilder.buildRootEntityLoadPlan( strategy, entityPersister );
    this.staticLoadQuery = BatchingLoadQueryDetailsFactory.makeEntityLoadQueryDetails(
        plan,
        uniqueKeyColumnNames,
        buildingParameters,
        factory
View Full Code Here

      boolean returnProxies,
      boolean readOnly,
      ResultTransformer forcedResultTransformer,
      List<AfterLoadAction> afterLoadActionList) throws SQLException {

    final LoadPlan loadPlan = loadPlanAdvisor.advise( this.baseLoadPlan );
    if ( loadPlan == null ) {
      throw new IllegalStateException( "LoadPlanAdvisor returned null" );
    }

    handlePotentiallyEmptyCollectionRootReturns( loadPlan, queryParameters.getCollectionKeys(), resultSet, session );

    final int maxRows;
    final RowSelection selection = queryParameters.getRowSelection();
    if ( LimitHelper.hasMaxRows( selection ) ) {
      maxRows = selection.getMaxRows();
      LOG.tracef( "Limiting ResultSet processing to just %s rows", maxRows );
    }
    else {
      maxRows = Integer.MAX_VALUE;
    }

    final ResultSetProcessingContextImpl context = new ResultSetProcessingContextImpl(
        resultSet,
        session,
        loadPlan,
        readOnly,
//        true, // use optional entity key?  for now, always say yes
        false, // use optional entity key?  actually for now always say no since in the simple test cases true causes failures because there is no optional key
        queryParameters,
        namedParameterContext,
        aliasResolutionContext,
        hadSubselectFetches
    );

    final List loadResults = new ArrayList();

    final int rootReturnCount = loadPlan.getReturns().size();

    LOG.trace( "Processing result set" );
    int count;
    for ( count = 0; count < maxRows && resultSet.next(); count++ ) {
      LOG.debugf( "Starting ResultSet row #%s", count );

      Object logicalRow;
      if ( rootReturnCount == 1 ) {
        loadPlan.getReturns().get( 0 ).hydrate( resultSet, context );
        loadPlan.getReturns().get( 0 ).resolve( resultSet, context );

        logicalRow = loadPlan.getReturns().get( 0 ).read( resultSet, context );
        context.readCollectionElements( new Object[] { logicalRow } );
      }
      else {
        for ( Return rootReturn : loadPlan.getReturns() ) {
          rootReturn.hydrate( resultSet, context );
        }
        for ( Return rootReturn : loadPlan.getReturns() ) {
          rootReturn.resolve( resultSet, context );
        }

        logicalRow = new Object[ rootReturnCount ];
        int pos = 0;
        for ( Return rootReturn : loadPlan.getReturns() ) {
          ( (Object[]) logicalRow )[pos] = rootReturn.read( resultSet, context );
          pos++;
        }
        context.readCollectionElements( (Object[]) logicalRow );
      }
View Full Code Here

            buildingParameters.getLockMode() != null
                ? buildingParameters.getLockMode()
                : buildingParameters.getLockOptions().getLockMode()
    );

    final LoadPlan plan = MetamodelDrivenLoadPlanBuilder.buildRootCollectionLoadPlan( strategy, collectionPersister );
    this.staticLoadQuery = BatchingLoadQueryDetailsFactory.makeCollectionLoadQueryDetails(
        collectionPersister,
        plan,
        buildingParameters
    );
View Full Code Here

TOP

Related Classes of org.hibernate.loader.plan.spi.LoadPlan

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.