Package org.hibernate.loader

Examples of org.hibernate.loader.OuterJoinableAssociation


    }

    public int[][] resolve() {
      int[][] compositeKeyManyToOneTargetIndices = null;
      for ( final String aliasWithCompositeId : aliasesForAssociationsWithCompositesIds ) {
        final OuterJoinableAssociation joinWithCompositeId = associationsByAlias.get( aliasWithCompositeId );
        final ArrayList<Integer> keyManyToOneTargetIndices = new ArrayList<Integer>();
        // for each association with a composite id containing key-many-to-one(s), find the bidirectional side of
        // each key-many-to-one (if exists) to see if it is eager as well.  If so, we need to track the indices
        EntityPersister entityPersister = null;
        if ( joinWithCompositeId.getJoinableType().isCollectionType() ) {
          entityPersister = ( ( QueryableCollection) joinWithCompositeId.getJoinable() ).getElementPersister();
        }
        else if ( joinWithCompositeId.getJoinableType().isEntityType() ) {
          entityPersister = ( EntityPersister ) joinWithCompositeId.getJoinable();
        }

        findKeyManyToOneTargetIndices(
            keyManyToOneTargetIndices,
            joinWithCompositeId,
View Full Code Here


    }

    private Integer locateKeyManyToOneTargetIndex(OuterJoinableAssociation joinWithCompositeId, EntityType keyManyToOneType) {
      // the lhs (if one) is a likely candidate
      if ( joinWithCompositeId.getLhsAlias() != null ) {
        final OuterJoinableAssociation lhs = associationsByAlias.get( joinWithCompositeId.getLhsAlias() );
        if ( keyManyToOneType.getAssociatedEntityName( factory ).equals( lhs.getJoinableType().getAssociatedEntityName( factory ) ) ) {
          return positionsByAlias.get( lhs.getRhsAlias() );
        }
      }
      // otherwise, seek out OuterJoinableAssociation which are RHS of given OuterJoinableAssociation
      // (joinWithCompositeId)
      for ( OuterJoinableAssociation oja : associationsByAlias.values() ) {
View Full Code Here

    walkEntityTree(elementPersister, alias);

    List allAssociations = new ArrayList();
    allAssociations.addAll(associations);
    allAssociations.add( new OuterJoinableAssociation(
        oneToManyPersister.getCollectionType(),
        null,
        null,
        alias,
        JoinFragment.LEFT_OUTER_JOIN,
View Full Code Here

    walkCollectionTree(collectionPersister, alias);

    List allAssociations = new ArrayList();
    allAssociations.addAll(associations);
    allAssociations.add( new OuterJoinableAssociation(
        collectionPersister.getCollectionType(),
        null,
        null,
        alias,
        JoinFragment.LEFT_OUTER_JOIN,
View Full Code Here

      // use its alias here
      // TODO : is there a better way here?
      Iterator itr = associations.iterator();
      AssociationType associationType = ( AssociationType ) collectionPersister.getElementType();
      while ( itr.hasNext() ) {
        OuterJoinableAssociation oja = ( OuterJoinableAssociation ) itr.next();
        if ( oja.getJoinableType() == associationType ) {
          // we found it
          filter += collectionPersister.getManyToManyFilterFragment(
              oja.getRHSAlias(),
              getEnabledFilters()
            );
            manyToManyOrderBy += collectionPersister.getManyToManyOrderByString( oja.getRHSAlias() );
        }
      }
    }
    whereString.insert( 0, StringHelper.moveAndToBeginning( filter ) );
View Full Code Here

    walkEntityTree(elementPersister, alias);

    List allAssociations = new ArrayList();
    allAssociations.addAll(associations);
    allAssociations.add( new OuterJoinableAssociation(
        oneToManyPersister.getCollectionType(),
        null,
        null,
        alias,
        JoinFragment.LEFT_OUTER_JOIN,
View Full Code Here

    walkCollectionTree(collectionPersister, alias);

    List allAssociations = new ArrayList();
    allAssociations.addAll(associations);
    allAssociations.add( new OuterJoinableAssociation(
        collectionPersister.getCollectionType(),
        null,
        null,
        alias,
        JoinFragment.LEFT_OUTER_JOIN,
View Full Code Here

      // use its alias here
      // TODO : is there a better way here?
      Iterator itr = associations.iterator();
      AssociationType associationType = ( AssociationType ) collectionPersister.getElementType();
      while ( itr.hasNext() ) {
        OuterJoinableAssociation oja = ( OuterJoinableAssociation ) itr.next();
        if ( oja.getJoinableType() == associationType ) {
          // we found it
          filter += collectionPersister.getManyToManyFilterFragment(
              oja.getRHSAlias(),
              getEnabledFilters()
            );
            manyToManyOrderBy += collectionPersister.getManyToManyOrderByString( oja.getRHSAlias() );
        }
      }
    }
    whereString.insert( 0, StringHelper.moveAndToBeginning( filter ) );
View Full Code Here

      // use its alias here
      // TODO : is there a better way here?
      Iterator itr = associations.iterator();
      AssociationType associationType = ( AssociationType ) collectionPersister.getElementType();
      while ( itr.hasNext() ) {
        OuterJoinableAssociation oja = ( OuterJoinableAssociation ) itr.next();
        if ( oja.getJoinableType() == associationType ) {
          // we found it
          filter += collectionPersister.getManyToManyFilterFragment(
              oja.getRHSAlias(),
              getLoadQueryInfluencers().getEnabledFilters()
            );
          manyToManyOrderBy += collectionPersister.getManyToManyOrderByString( oja.getRHSAlias() );
        }
      }
    }
    whereString.insert( 0, StringHelper.moveAndToBeginning( filter ) );
View Full Code Here

    }

    public int[][] resolve() {
      int[][] compositeKeyManyToOneTargetIndices = null;
      for ( final String aliasWithCompositeId : aliasesForAssociationsWithCompositesIds ) {
        final OuterJoinableAssociation joinWithCompositeId = associationsByAlias.get( aliasWithCompositeId );
        final ArrayList<Integer> keyManyToOneTargetIndices = new ArrayList<Integer>();
        // for each association with a composite id containing key-many-to-one(s), find the bidirectional side of
        // each key-many-to-one (if exists) to see if it is eager as well.  If so, we need to track the indices
        EntityPersister entityPersister = null;
        if ( joinWithCompositeId.getJoinableType().isCollectionType() ) {
          entityPersister = ( ( QueryableCollection) joinWithCompositeId.getJoinable() ).getElementPersister();
        }
        else if ( joinWithCompositeId.getJoinableType().isEntityType() ) {
          entityPersister = ( EntityPersister ) joinWithCompositeId.getJoinable();
        }

        findKeyManyToOneTargetIndices(
            keyManyToOneTargetIndices,
            joinWithCompositeId,
View Full Code Here

TOP

Related Classes of org.hibernate.loader.OuterJoinableAssociation

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.