Package org.hibernate.loader.plan2.build.spi

Examples of org.hibernate.loader.plan2.build.spi.QuerySpaceTreePrinter


    this.entityPersister = entityPersister;
    this.factory = factory;
    this.uniqueKeyType = uniqueKeyType;
    this.entityName = entityPersister.getEntityName();

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

    this.plan = MetamodelDrivenLoadPlanBuilder.buildRootEntityLoadPlan( strategy, entityPersister );
View Full Code Here


    // if we get here, it is a root
    if ( ! supportsRootCollectionReturns() ) {
      throw new HibernateException( "This strategy does not support root collection returns" );
    }

    final CollectionReturn collectionReturn = new CollectionReturnImpl( collectionDefinition, this );
    pushToCollectionStack( collectionReturn );
    addRootReturn( collectionReturn );

    // also add an AssociationKey for the root so we can later on recognize circular references back to the root.
    // for a collection, the circularity would always be to an entity element...
    if ( collectionReturn.getElementGraph() != null ) {
      if ( EntityReference.class.isInstance( collectionReturn.getElementGraph() ) ) {
        final EntityReference entityReference = (EntityReference) collectionReturn.getElementGraph();
        final Joinable entityPersister = (Joinable) entityReference.getEntityPersister();
        associationKeyRegistered(
            new AssociationKey( entityPersister.getTableName(), entityPersister.getKeyColumnNames() )
        );
      }
View Full Code Here

    // if we get here, it is a root
    if ( !supportsRootEntityReturns() ) {
      throw new HibernateException( "This strategy does not support root entity returns" );
    }

    final EntityReturnImpl entityReturn = new EntityReturnImpl( entityDefinition, this );
    addRootReturn( entityReturn );
    pushToStack( entityReturn );

    // also add an AssociationKey for the root so we can later on recognize circular references back to the root.
    final Joinable entityPersister = (Joinable) entityDefinition.getEntityPersister();
View Full Code Here

  private final ArrayDeque<ExpandingFetchSource> fetchSourceStack = new ArrayDeque<ExpandingFetchSource>();

  protected AbstractLoadPlanBuildingAssociationVisitationStrategy(SessionFactoryImplementor sessionFactory) {
    this.sessionFactory = sessionFactory;
    this.querySpaces = new QuerySpacesImpl( sessionFactory );
  }
View Full Code Here

  @Override
  public CompositeFetch buildCompositeFetch(
      CompositionDefinition attributeDefinition,
      LoadPlanBuildingContext loadPlanBuildingContext) {
    final ExpandingQuerySpace leftHandSide = expandingQuerySpace();
    final Join join = leftHandSide.addCompositeJoin(
        attributeDefinition,
        loadPlanBuildingContext.getQuerySpaces().generateImplicitUid()
    );
    final CompositeFetch fetch = createCompositeFetch(
        attributeDefinition.getType(),
View Full Code Here

      String[] keyColumnNames,
      boolean shouldUseOptionalEntityInformation,
      QueryBuildingParameters buildingParameters,
      SessionFactoryImplementor factory) {
    this.loadPlan = loadPlan;
    final AliasResolutionContextImpl aliasResolutionContext = new AliasResolutionContextImpl( factory );

//    LoadPlanTreePrinter.INSTANCE.logTree( loadPlan, aliasResolutionContext );
//    if ( log.isDebugEnabled() ) {
//      log.debug( LoadPlanTreePrinter.INSTANCE.toString( loadPlan ) );
//    }
View Full Code Here

    );

    // Next, we process the Returns and Fetches building the SELECT clause and at the same time building
    // Readers for reading the described results out of a SQL ResultSet

    final FetchStats fetchStats = processReturnAndFetches(
        rootReturn,
        select,
        helper,
        readerCollector,
        aliasResolutionContext
    );

    LoadPlanTreePrinter.INSTANCE.logTree( loadPlan, aliasResolutionContext );

    this.sqlStatement = select.toStatementString();
    this.resultSetProcessor = new ResultSetProcessorImpl(
        loadPlan,
        readerCollector.buildRowReader(),
        fetchStats.hasSubselectFetches()
    );
  }
View Full Code Here

            entityReferenceAliases.getTableAlias(),
            entityReferenceAliases.getColumnAliases().getSuffix()
        )
    );

    final FetchStats fetchStats = helper.processFetches(
        rootReturn,
        select,
        readerCollector
    );
View Full Code Here

    final SelectStatementBuilder select = new SelectStatementBuilder( factory.getDialect() );
    final EntityReturn rootReturn = Helper.INSTANCE.extractRootReturn( loadPlan, EntityReturn.class );
    final ReaderCollectorImpl readerCollector = new ReaderCollectorImpl();

    final LoadQueryJoinAndFetchProcessor helper = new LoadQueryJoinAndFetchProcessor( aliasResolutionContext , buildingParameters, factory );

    final String[] keyColumnNamesToUse = keyColumnNames != null
        ? keyColumnNames
        : ( (Queryable) rootReturn.getEntityPersister() ).getIdentifierColumnNames();
View Full Code Here

    if ( fetch.getElementGraph() != null ) {
      processFetches( fetch.getElementGraph(), selectStatementBuilder, readerCollector );
    }

    readerCollector.add( new CollectionReferenceInitializerImpl( fetch, aliases ) );
  }
View Full Code Here

TOP

Related Classes of org.hibernate.loader.plan2.build.spi.QuerySpaceTreePrinter

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.