Package org.hibernate.loader.plan.spi

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


//    }

    final FetchOwner fetchOwner = currentFetchOwner();
    fetchOwner.validateFetchPlan( fetchStrategy, attributeDefinition );

    final Fetch associationFetch;
    final AssociationAttributeDefinition.AssociationNature nature = attributeDefinition.getAssociationNature();
    if ( nature == AssociationAttributeDefinition.AssociationNature.ANY ) {
      return false;
//      throw new NotYetImplementedException( "AnyType support still in progress" );
    }
View Full Code Here


  }

  private JoinableAssociationAliasesImpl getOrGenerateJoinAssocationAliases(JoinableAssociation joinableAssociation) {
    JoinableAssociationAliasesImpl aliases = aliasesByJoinableAssociation.get( joinableAssociation );
    if ( aliases == null ) {
      final Fetch currentFetch = joinableAssociation.getCurrentFetch();
      final String lhsAlias;
      if ( AnyFetch.class.isInstance( currentFetch ) ) {
        throw new WalkingException( "Any type should never be joined!" );
      }
      else if ( EntityReference.class.isInstance( currentFetch.getOwner() ) ) {
        lhsAlias = resolveAliases( (EntityReference) currentFetch.getOwner() ).getTableAlias();
      }
      else if ( CompositeFetch.class.isInstance( currentFetch.getOwner() ) ) {
        lhsAlias = resolveAliases(
            locateCompositeFetchEntityReferenceSource( (CompositeFetch) currentFetch.getOwner() )
        ).getTableAlias();
      }
      else if ( CompositeElementGraph.class.isInstance( currentFetch.getOwner() ) ) {
        CompositeElementGraph compositeElementGraph = (CompositeElementGraph) currentFetch.getOwner();
        lhsAlias = resolveAliases( compositeElementGraph.getCollectionReference() ).getElementTableAlias();
      }
      else if ( CompositeIndexGraph.class.isInstance( currentFetch.getOwner() ) ) {
        CompositeIndexGraph compositeIndexGraph = (CompositeIndexGraph) currentFetch.getOwner();
        lhsAlias = resolveAliases( compositeIndexGraph.getCollectionReference() ).getElementTableAlias();
      }
      else {
        throw new NotYetImplementedException( "Cannot determine LHS alias for FetchOwner." );
      }

      final String[] aliasedLhsColumnNames = currentFetch.toSqlSelectFragments( lhsAlias );
      final String rhsAlias;
      if ( EntityReference.class.isInstance( currentFetch ) ) {
        rhsAlias = resolveAliases( (EntityReference) currentFetch ).getTableAlias();
      }
      else if ( CollectionReference.class.isInstance( joinableAssociation.getCurrentFetch() ) ) {
View Full Code Here

  }

  private JoinableAssociationAliasesImpl getOrGenerateJoinAssocationAliases(JoinableAssociation joinableAssociation) {
    JoinableAssociationAliasesImpl aliases = aliasesByJoinableAssociation.get( joinableAssociation );
    if ( aliases == null ) {
      final Fetch currentFetch = joinableAssociation.getCurrentFetch();
      final String lhsAlias;
      if ( EntityReference.class.isInstance( currentFetch.getOwner() ) ) {
        lhsAlias = resolveEntityTableAlias( (EntityReference) currentFetch.getOwner() );
      }
      else {
        throw new NotYetImplementedException( "Cannot determine LHS alias for a FetchOwner that is not an EntityReference yet." );
      }
      final String rhsAlias;
      if ( EntityReference.class.isInstance( currentFetch ) ) {
        rhsAlias = resolveEntityTableAlias( (EntityReference) currentFetch );
      }
      else if ( CollectionReference.class.isInstance( joinableAssociation.getCurrentFetch() ) ) {
        rhsAlias = resolveCollectionTableAlias( (CollectionReference) currentFetch );
      }
      else {
        throw new NotYetImplementedException( "Cannot determine RHS alis for a fetch that is not an EntityReference or CollectionReference." );
      }

      // TODO: can't this be found in CollectionAliases or EntityAliases? should be moved to LoadQueryAliasResolutionContextImpl
      final OuterJoinLoadable fetchSourcePersister = (OuterJoinLoadable) currentFetch.getOwner().retrieveFetchSourcePersister();
      final int propertyNumber = fetchSourcePersister.getEntityMetamodel().getPropertyIndex( currentFetch.getOwnerPropertyName() );
      final String[] aliasedLhsColumnNames = JoinHelper.getAliasedLHSColumnNames(
          joinableAssociation.getAssociationType(),
          lhsAlias,
          propertyNumber,
          fetchSourcePersister,
View Full Code Here

    }

    final FetchOwner fetchOwner = currentFetchOwner();
    fetchOwner.validateFetchPlan( fetchStrategy );

    final Fetch associationFetch;
    if ( attributeDefinition.isCollection() ) {
      associationFetch = fetchOwner.buildCollectionFetch( attributeDefinition, fetchStrategy, this );
      pushToCollectionStack( (CollectionReference) associationFetch );
    }
    else {
View Full Code Here

    }

    final FetchOwner fetchOwner = currentFetchOwner();
    fetchOwner.validateFetchPlan( fetchStrategy );

    final Fetch associationFetch;
    if ( attributeDefinition.isCollection() ) {
      associationFetch = fetchOwner.buildCollectionFetch( attributeDefinition, fetchStrategy, this );
      pushToCollectionStack( (CollectionReference) associationFetch );
    }
    else {
View Full Code Here

  }

  private JoinableAssociationAliasesImpl getOrGenerateJoinAssocationAliases(JoinableAssociation joinableAssociation) {
    JoinableAssociationAliasesImpl aliases = aliasesByJoinableAssociation.get( joinableAssociation );
    if ( aliases == null ) {
      final Fetch currentFetch = joinableAssociation.getCurrentFetch();
      final String lhsAlias;
      if ( EntityReference.class.isInstance( currentFetch.getOwner() ) ) {
        lhsAlias = resolveEntityTableAlias( (EntityReference) currentFetch.getOwner() );
      }
      else if ( CompositeElementGraph.class.isInstance( currentFetch.getOwner() ) ) {
        CompositeElementGraph compositeElementGraph = (CompositeElementGraph) currentFetch.getOwner();
        lhsAlias = resolveCollectionTableAlias( compositeElementGraph.getCollectionReference() );
      }
      else if ( CompositeIndexGraph.class.isInstance( currentFetch.getOwner() ) ) {
        CompositeIndexGraph compositeIndexGraph = (CompositeIndexGraph) currentFetch.getOwner();
        lhsAlias = resolveCollectionTableAlias( compositeIndexGraph.getCollectionReference() );
      }
      else {
        throw new NotYetImplementedException( "Cannot determine LHS alias for FetchOwner." );
      }

      final String[] aliasedLhsColumnNames = currentFetch.toSqlSelectFragments( lhsAlias );
      final String rhsAlias;
      if ( EntityReference.class.isInstance( currentFetch ) ) {
        rhsAlias = resolveEntityTableAlias( (EntityReference) currentFetch );
      }
      else if ( CollectionReference.class.isInstance( joinableAssociation.getCurrentFetch() ) ) {
View Full Code Here

  }

  private JoinableAssociationAliasesImpl getOrGenerateJoinAssocationAliases(JoinableAssociation joinableAssociation) {
    JoinableAssociationAliasesImpl aliases = aliasesByJoinableAssociation.get( joinableAssociation );
    if ( aliases == null ) {
      final Fetch currentFetch = joinableAssociation.getCurrentFetch();
      final String lhsAlias;
      if ( EntityReference.class.isInstance( currentFetch.getOwner() ) ) {
        lhsAlias = resolveEntityTableAlias( (EntityReference) currentFetch.getOwner() );
      }
      else if ( CompositeElementGraph.class.isInstance( currentFetch.getOwner() ) ) {
        CompositeElementGraph compositeElementGraph = (CompositeElementGraph) currentFetch.getOwner();
        lhsAlias = resolveCollectionTableAlias( compositeElementGraph.getCollectionReference() );
      }
      else if ( CompositeIndexGraph.class.isInstance( currentFetch.getOwner() ) ) {
        CompositeIndexGraph compositeIndexGraph = (CompositeIndexGraph) currentFetch.getOwner();
        lhsAlias = resolveCollectionTableAlias( compositeIndexGraph.getCollectionReference() );
      }
      else {
        throw new NotYetImplementedException( "Cannot determine LHS alias for FetchOwner." );
      }
      final String[] aliasedLhsColumnNames = StringHelper.qualify( lhsAlias, currentFetch.getColumnNames() );
      final String rhsAlias;
      if ( EntityReference.class.isInstance( currentFetch ) ) {
        rhsAlias = resolveEntityTableAlias( (EntityReference) currentFetch );
      }
      else if ( CollectionReference.class.isInstance( joinableAssociation.getCurrentFetch() ) ) {
View Full Code Here

    }

    final FetchOwner fetchOwner = currentFetchOwner();
    fetchOwner.validateFetchPlan( fetchStrategy );

    final Fetch associationFetch;
    if ( attributeDefinition.isCollection() ) {
      associationFetch = fetchOwner.buildCollectionFetch( attributeDefinition, fetchStrategy, this );
      pushToCollectionStack( (CollectionReference) associationFetch );
    }
    else {
View Full Code Here

TOP

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

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.