Package org.hibernate.loader.plan2.exec.process.internal

Examples of org.hibernate.loader.plan2.exec.process.internal.EntityReferenceInitializerImpl


        "%s Starting collection index graph : %s",
        StringHelper.repeat( ">>", fetchSourceStack.size() ),
        indexDefinition.getCollectionDefinition().getCollectionPersister().getRole()
    );

    final CollectionReference collectionReference = collectionReferenceStack.peekFirst();
    final CollectionFetchableIndex indexGraph = collectionReference.getIndexGraph();

    if ( indexType.isEntityType() || indexType.isComponentType() ) {
      if ( indexGraph == null ) {
        throw new WalkingException(
            "CollectionReference did not return an expected index graph : " +
View Full Code Here


        "%s Starting collection element graph : %s",
        StringHelper.repeat( ">>", fetchSourceStack.size() ),
        elementDefinition.getCollectionDefinition().getCollectionPersister().getRole()
    );

    final CollectionReference collectionReference = collectionReferenceStack.peekFirst();
    final CollectionFetchableElement elementGraph = collectionReference.getElementGraph();

    if ( elementType.isAssociationType() || elementType.isComponentType() ) {
      if ( elementGraph == null ) {
        throw new IllegalStateException(
            "CollectionReference did not return an expected element graph : " +
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

      final EntityFetch entityFetch = (EntityFetch) fetch;
      printWriter.println( extractDetails( entityFetch ) );
      writeEntityReferenceFetches( entityFetch, depth+1, printWriter );
    }
    else if ( CompositeFetch.class.isInstance( fetch ) ) {
      final CompositeFetch compositeFetch = (CompositeFetch) fetch;
      printWriter.println( extractDetails( compositeFetch ) );
      writeCompositeFetchFetches( compositeFetch, depth+1, printWriter );
    }
    else if ( CollectionFetch.class.isInstance( fetch ) ) {
      final CollectionFetch collectionFetch = (CollectionFetch) fetch;
View Full Code Here

          final EntityReference indexGraphAsEntityReference = (EntityReference) indexGraph;
          printWriter.println( extractDetails( indexGraphAsEntityReference ) );
          writeEntityReferenceFetches( indexGraphAsEntityReference, depth+1, printWriter );
        }
        else if ( CompositeFetch.class.isInstance( indexGraph ) ) {
          final CompositeFetch indexGraphAsCompositeFetch = (CompositeFetch) indexGraph;
          printWriter.println( extractDetails( indexGraphAsCompositeFetch ) );
          writeCompositeFetchFetches( indexGraphAsCompositeFetch, depth+1, printWriter );
        }
      }
    }

    final CollectionFetchableElement elementGraph = collectionReference.getElementGraph();
    if ( elementGraph != null ) {
      printWriter.print( TreePrinterHelper.INSTANCE.generateNodePrefix( depth ) + "(collection element) " );

      if ( EntityReference.class.isInstance( elementGraph ) ) {
        final EntityReference elementGraphAsEntityReference = (EntityReference) elementGraph;
        printWriter.println( extractDetails( elementGraphAsEntityReference ) );
        writeEntityReferenceFetches( elementGraphAsEntityReference, depth+1, printWriter );
      }
      else if ( CompositeFetch.class.isInstance( elementGraph ) ) {
        final CompositeFetch elementGraphAsCompositeFetch = (CompositeFetch) elementGraph;
        printWriter.println( extractDetails( elementGraphAsCompositeFetch ) );
        writeCompositeFetchFetches( elementGraphAsCompositeFetch, depth+1, printWriter );
      }
    }
  }
View Full Code Here

    final ExpandingQuerySpace leftHandSide = expandingQuerySpace();
    final Join join = leftHandSide.addCompositeJoin(
        attributeDefinition,
        loadPlanBuildingContext.getQuerySpaces().generateImplicitUid()
    );
    final CompositeFetch fetch = createCompositeFetch(
        attributeDefinition.getType(),
        (ExpandingCompositeQuerySpace) join.getRightHandSide()
    );
    addFetch( fetch );
    return fetch;
View Full Code Here

    if ( fetchSourceStack.isEmpty() ) {
      throw new HibernateException( "A component cannot be the root of a walk nor a graph" );
    }

    final CompositeFetch compositeFetch = currentSource().buildCompositeFetch( compositionDefinition, this );
    pushToStack( (ExpandingFetchSource) compositeFetch );
  }
View Full Code Here

          entityQuerySpace.getUid(),
          entityQuerySpace.getEntityPersister().getEntityName()
      );
    }
    else if ( CompositeQuerySpace.class.isInstance( space ) ) {
      final CompositeQuerySpace compositeQuerySpace = (CompositeQuerySpace) space;
      return String.format(
          "%s(uid=%s)",
          compositeQuerySpace.getClass().getSimpleName(),
          compositeQuerySpace.getUid()
      );
    }
    else if ( CollectionQuerySpace.class.isInstance( space ) ) {
      final CollectionQuerySpace collectionQuerySpace = (CollectionQuerySpace) space;
      return String.format(
View Full Code Here

    if ( ! FetchStrategyHelper.isJoinFetched( fetch.getFetchStrategy() ) ) {
      return;
    }

    if ( EntityFetch.class.isInstance( fetch ) ) {
      final EntityFetch entityFetch = (EntityFetch) fetch;
      processEntityFetch(
          selectStatementBuilder,
          fetchSource,
          entityFetch,
          readerCollector,
View Full Code Here

      );
      targetEntityReferenceInitializer.hydrateEntityState( resultSet, context );
    }
    for ( Fetch fetch : fetchSource.getFetches() ) {
      if ( EntityFetch.class.isInstance( fetch ) ) {
        final EntityFetch entityFetch = (EntityFetch) fetch;
        final EntityReferenceInitializer  entityReferenceInitializer = initializerByEntityReference.get( entityFetch );
        if ( entityReferenceInitializer != null ) {
          resolveEntityKey(
              resultSet,
              context,
View Full Code Here

TOP

Related Classes of org.hibernate.loader.plan2.exec.process.internal.EntityReferenceInitializerImpl

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.