Package org.hibernate.loader.plan.spi

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


  }

  @Override
  public void finishingEntity(EntityDefinition entityDefinition) {
    // Only process the entityDefinition if it is for the root return.
    final FetchSource currentSource = currentSource();
    final boolean isRoot = EntityReturn.class.isInstance( currentSource ) &&
        entityDefinition.getEntityPersister().equals( EntityReturn.class.cast( currentSource ).getEntityPersister() );
    if ( !isRoot ) {
      // if not, this call should represent a fetch which will be handled in #finishingAttribute
      return;
View Full Code Here


      throw new HibernateException( "A component cannot be the root of a walk nor a graph" );
    }

    // No need to push anything here; it should have been pushed by
    // #startingAttribute, #startingCollectionElements, #startingCollectionIndex, or #startingEntityIdentifier
    final FetchSource currentSource = currentSource();
    if ( !CompositeFetch.class.isInstance( currentSource ) &&
        !CollectionFetchableElement.class.isInstance( currentSource ) &&
        !CollectionFetchableIndex.class.isInstance( currentSource ) &&
        !ExpandingEntityIdentifierDescription.class.isInstance( currentSource ) ) {
      throw new WalkingException( "Mismatched FetchSource from stack on pop" );
View Full Code Here

      // (i.e., derived attribute) which is mapped by attributeDefinition.
      // This is not a bidirectional association.
      // TODO: AFAICT, to avoid an overflow, the associated entity must already be loaded into the session, or
      // it must be loaded when the ID for the dependent entity is resolved. Is there some other way to
      // deal with this???
      final FetchSource registeredFetchSource = registeredFetchSource( associationKey );
      if ( registeredFetchSource != null && ! associationKey.equals( currentEntityReferenceAssociationKey ) ) {
        currentSource().buildBidirectionalEntityReference(
            attributeDefinition,
            fetchStrategy,
            registeredFetchSource( associationKey ).resolveEntityReference()
View Full Code Here

    //
    // what if fetchSource is a composite fetch (as it would be in the case of a key-many-to-one)?
    if ( EntityReference.class.isInstance( fetchSource ) ) {
      final EntityReference fetchOwnerAsEntityReference = (EntityReference) fetchSource;
      if ( fetchOwnerAsEntityReference.getIdentifierDescription().hasFetches() ) {
        final FetchSource entityIdentifierAsFetchSource = (FetchSource) fetchOwnerAsEntityReference.getIdentifierDescription();
        for ( Fetch fetch : entityIdentifierAsFetchSource.getFetches() ) {
          processFetch(
              selectStatementBuilder,
              fetchSource,
              fetch,
              readerCollector,
View Full Code Here

        )
    );

    // process its identifier fetches first (building EntityReferenceInitializers for them if needed)
    if ( fetch.getIdentifierDescription().hasFetches() ) {
      final FetchSource entityIdentifierAsFetchSource = (FetchSource) fetch.getIdentifierDescription();
      for ( Fetch identifierFetch : entityIdentifierAsFetchSource.getFetches() ) {
        processFetch(
            selectStatementBuilder,
            fetch,
            identifierFetch,
            readerCollector,
View Full Code Here

    //
    // what if fetchSource is a composite fetch (as it would be in the case of a key-many-to-one)?
    if ( EntityReference.class.isInstance( fetchSource ) ) {
      final EntityReference fetchOwnerAsEntityReference = (EntityReference) fetchSource;
      if ( fetchOwnerAsEntityReference.getIdentifierDescription().hasFetches() ) {
        final FetchSource entityIdentifierAsFetchSource = (FetchSource) fetchOwnerAsEntityReference.getIdentifierDescription();
        for ( Fetch fetch : entityIdentifierAsFetchSource.getFetches() ) {
          processFetch(
              selectStatementBuilder,
              fetchSource,
              fetch,
              readerCollector,
View Full Code Here

        )
    );

    // process its identifier fetches first (building EntityReferenceInitializers for them if needed)
    if ( fetch.getIdentifierDescription().hasFetches() ) {
      final FetchSource entityIdentifierAsFetchSource = (FetchSource) fetch.getIdentifierDescription();
      for ( Fetch identifierFetch : entityIdentifierAsFetchSource.getFetches() ) {
        processFetch(
            selectStatementBuilder,
            fetch,
            identifierFetch,
            readerCollector,
View Full Code Here

  }

  @Override
  public void finishingEntity(EntityDefinition entityDefinition) {
    // Only process the entityDefinition if it is for the root return.
    final FetchSource currentSource = currentSource();
    final boolean isRoot = EntityReturn.class.isInstance( currentSource ) &&
        entityDefinition.getEntityPersister().equals( EntityReturn.class.cast( currentSource ).getEntityPersister() );
    if ( !isRoot ) {
      // if not, this call should represent a fetch which will be handled in #finishingAttribute
      return;
View Full Code Here

      throw new HibernateException( "A component cannot be the root of a walk nor a graph" );
    }

    // No need to push anything here; it should have been pushed by
    // #startingAttribute, #startingCollectionElements, #startingCollectionIndex, or #startingEntityIdentifier
    final FetchSource currentSource = currentSource();
    if ( !CompositeFetch.class.isInstance( currentSource ) &&
        !CollectionFetchableElement.class.isInstance( currentSource ) &&
        !CollectionFetchableIndex.class.isInstance( currentSource ) &&
        !ExpandingEntityIdentifierDescription.class.isInstance( currentSource ) ) {
      throw new WalkingException( "Mismatched FetchSource from stack on pop" );
View Full Code Here

      // (i.e., derived attribute) which is mapped by attributeDefinition.
      // This is not a bidirectional association.
      // TODO: AFAICT, to avoid an overflow, the associated entity must already be loaded into the session, or
      // it must be loaded when the ID for the dependent entity is resolved. Is there some other way to
      // deal with this???
      final FetchSource registeredFetchSource = registeredFetchSource( associationKey );
      if ( registeredFetchSource != null && ! associationKey.equals( currentEntityReferenceAssociationKey ) ) {
        currentSource().buildBidirectionalEntityReference(
            attributeDefinition,
            fetchStrategy,
            registeredFetchSource( associationKey ).resolveEntityReference()
View Full Code Here

TOP

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

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.