/** * Count the number of instances of Joinable which are actually * also instances of Loadable, or are one-to-many associations */ protected static int countEntityPersisters(List associations) throws MappingException { int result = 0; for ( Object association : associations ) { final OuterJoinableAssociation oj = (OuterJoinableAssociation) association; if ( oj.getJoinable().consumesEntityAlias() ) { result++; } } return result; }
entityPersister = ( ( QueryableCollection) joinWithCompositeId.getJoinable() ).getElementPersister(); entityPersister = ( EntityPersister ) joinWithCompositeId.getJoinable();
public void associationProcessed(OuterJoinableAssociation oja, int position) { associationsByAlias.put( oja.getRhsAlias(), oja ); positionsByAlias.put( oja.getRhsAlias(), position ); EntityPersister entityPersister = null; if ( oja.getJoinableType().isCollectionType() ) { entityPersister = ( ( QueryableCollection) oja.getJoinable() ).getElementPersister(); } else if ( oja.getJoinableType().isEntityType() ) { entityPersister = ( EntityPersister ) oja.getJoinable(); } if ( entityPersister != null && entityPersister.getIdentifierType().isComponentType() && ! entityPersister.getEntityMetamodel().getIdentifierProperty().isEmbedded() && hasAssociation( (CompositeType) entityPersister.getIdentifierType() ) ) { aliasesForAssociationsWithCompositesIds.add( oja.getRhsAlias() ); } }
/** * Get the position of the join with the given alias in the * list of joins */ private static int getPosition(String lhsAlias, List associations) { int result = 0; for ( Object association : associations ) { final OuterJoinableAssociation oj = (OuterJoinableAssociation) association; if ( oj.getJoinable().consumesEntityAlias() /*|| oj.getJoinable().consumesCollectionAlias() */ ) { if ( oj.rhsAlias.equals( lhsAlias ) ) { return result; } result++; } } return -1; }
if ( !oj.isCollection() ) { persisters[i] = (Loadable) oj.getJoinable(); aliases[i] = oj.getRHSAlias(); owners[i] = oj.getOwner( associations ); QueryableCollection collPersister = (QueryableCollection) oj.getJoinable(); if ( oj.getJoinType() == JoinType.LEFT_OUTER_JOIN && !oj.hasRestriction() ) {
OuterJoinableAssociation oj = (OuterJoinableAssociation) iter.next(); if ( oj.getJoinType() == JoinType.LEFT_OUTER_JOIN ) { // why does this matter? if ( oj.getJoinable().isCollection() ) { final QueryableCollection queryableCollection = (QueryableCollection) oj.getJoinable(); if ( queryableCollection.hasOrdering() ) { final String orderByString = queryableCollection.getSQLOrderByString( oj.getRHSAlias() ); if ( last != null && last.getJoinable().isCollection() ) { final QueryableCollection queryableCollection = (QueryableCollection) last.getJoinable(); if ( queryableCollection.isManyToMany() && last.isManyToManyWith( oj ) ) { if ( queryableCollection.hasManyToManyOrdering() ) {
public void associationProcessed(OuterJoinableAssociation oja, int position) { associationsByAlias.put( oja.getRhsAlias(), oja ); positionsByAlias.put( oja.getRhsAlias(), position ); EntityPersister entityPersister = null; if ( oja.getJoinableType().isCollectionType() ) { entityPersister = ( ( QueryableCollection) oja.getJoinable() ).getElementPersister(); } else if ( oja.getJoinableType().isEntityType() ) { entityPersister = ( EntityPersister ) oja.getJoinable(); } if ( entityPersister != null && entityPersister.getIdentifierType().isComponentType() && ! entityPersister.getEntityMetamodel().getIdentifierProperty().isEmbedded() && hasAssociation( (CompositeType) entityPersister.getIdentifierType() ) ) { aliasesForAssociationsWithCompositesIds.add( oja.getRhsAlias() ); } }
? null : (OuterJoinableAssociation) associations.get( i + 1 ); final Joinable joinable = join.getJoinable(); final String entitySuffix = ( suffixes == null || entityAliasCount >= suffixes.length ) ? null : collectionSuffixes[collectionAliasCount]; final String selectFragment = joinable.selectFragment( next == null ? null : next.getJoinable(), next == null ? null : next.getRHSAlias(), join.getRHSAlias(),
public void associationProcessed(OuterJoinableAssociation oja, int position) { associationsByAlias.put( oja.getRhsAlias(), oja ); positionsByAlias.put( oja.getRhsAlias(), position ); EntityPersister entityPersister = null; if ( oja.getJoinableType().isCollectionType() ) { entityPersister = ( ( QueryableCollection) oja.getJoinable() ).getElementPersister(); } else if ( oja.getJoinableType().isEntityType() ) { entityPersister = ( EntityPersister ) oja.getJoinable(); } if ( entityPersister != null && entityPersister.getIdentifierType().isComponentType() && ! entityPersister.getEntityMetamodel().getIdentifierProperty().isEmbedded() && hasAssociation( (CompositeType) entityPersister.getIdentifierType() ) ) { aliasesForAssociationsWithCompositesIds.add( oja.getRhsAlias() ); } }
/** * Generate a sequence of <tt>LEFT OUTER JOIN</tt> clauses for the given associations. */ protected final JoinFragment mergeOuterJoins(List associations) throws MappingException { JoinFragment outerjoin = getDialect().createOuterJoinFragment(); Iterator iter = associations.iterator(); OuterJoinableAssociation last = null; while ( iter.hasNext() ) { final OuterJoinableAssociation oj = (OuterJoinableAssociation) iter.next(); if ( last != null && last.isManyToManyWith( oj ) ) { oj.addManyToManyJoin( outerjoin, (QueryableCollection) last.getJoinable() ); } else { oj.addJoins( outerjoin ); } last = oj; } last = null; return outerjoin; }
/** * Count the number of instances of Joinable which are actually * also instances of PersistentCollection which are being fetched * by outer join */ protected static int countCollectionPersisters(List associations) throws MappingException { int result = 0; for ( Object association : associations ) { final OuterJoinableAssociation oj = (OuterJoinableAssociation) association; if ( oj.getJoinType() == JoinType.LEFT_OUTER_JOIN && oj.getJoinable().isCollection() && !oj.hasRestriction() ) { result++; } } return result; }
/** * Get the position of the join with the given alias in the * list of joins */ private static int getPosition(String lhsAlias, List associations) { int result = 0; for ( int i=0; i<associations.size(); i++ ) { OuterJoinableAssociation oj = (OuterJoinableAssociation) associations.get(i); if ( oj.getJoinable().consumesEntityAlias() /*|| oj.getJoinable().consumesCollectionAlias() */ ) { if ( oj.rhsAlias.equals(lhsAlias) ) return result; result++; } } return -1; }
/** * Get the position of the join with the given alias in the * list of joins */ private static int getPosition(String lhsAlias, List associations) { int result = 0; for ( int i=0; i<associations.size(); i++ ) { OuterJoinableAssociation oj = (OuterJoinableAssociation) associations.get(i); if ( oj.getJoinable().consumesEntityAlias() /*|| oj.getJoinable().consumesCollectionAlias() */ ) { if ( oj.rhsAlias.equals(lhsAlias) ) return result; result++; } } return -1; }
/** * Get the position of the join with the given alias in the * list of joins */ private static int getPosition(String lhsAlias, List associations) { int result = 0; for ( int i=0; i<associations.size(); i++ ) { OuterJoinableAssociation oj = (OuterJoinableAssociation) associations.get(i); if ( oj.getJoinable().consumesEntityAlias() /*|| oj.getJoinable().consumesCollectionAlias() */ ) { if ( oj.rhsAlias.equals(lhsAlias) ) return result; result++; } } return -1; }
/** * Get the position of the join with the given alias in the * list of joins */ private static int getPosition(String lhsAlias, List associations) { int result = 0; for ( int i=0; i<associations.size(); i++ ) { OuterJoinableAssociation oj = (OuterJoinableAssociation) associations.get(i); if ( oj.getJoinable().consumesEntityAlias() /*|| oj.getJoinable().consumesCollectionAlias() */ ) { if ( oj.rhsAlias.equals(lhsAlias) ) return result; result++; } } return -1; }
/** * Count the number of instances of Joinable which are actually * also instances of Loadable, or are one-to-many associations */ protected static final int countEntityPersisters(List associations) throws MappingException { int result = 0; Iterator iter = associations.iterator(); while ( iter.hasNext() ) { OuterJoinableAssociation oj = (OuterJoinableAssociation) iter.next(); if ( oj.getJoinable().consumesEntityAlias() ) { result++; } } return result; }
/** * Count the number of instances of Joinable which are actually * also instances of Loadable, or are one-to-many associations */ protected static final int countEntityPersisters(List associations) throws MappingException { int result = 0; Iterator iter = associations.iterator(); while ( iter.hasNext() ) { OuterJoinableAssociation oj = (OuterJoinableAssociation) iter.next(); if ( oj.getJoinable().consumesEntityAlias() ) { result++; } } return result; }
/** * Count the number of instances of Joinable which are actually * also instances of Loadable, or are one-to-many associations */ protected static final int countEntityPersisters(List associations) throws MappingException { int result = 0; Iterator iter = associations.iterator(); while ( iter.hasNext() ) { OuterJoinableAssociation oj = (OuterJoinableAssociation) iter.next(); if ( oj.getJoinable().consumesEntityAlias() ) { result++; } } return result; }
/** * Count the number of instances of Joinable which are actually * also instances of Loadable, or are one-to-many associations */ protected static final int countEntityPersisters(List associations) throws MappingException { int result = 0; Iterator iter = associations.iterator(); while ( iter.hasNext() ) { OuterJoinableAssociation oj = (OuterJoinableAssociation) iter.next(); if ( oj.getJoinable().consumesEntityAlias() ) { result++; } } return result; }
/** * Count the number of instances of Joinable which are actually * also instances of PersistentCollection which are being fetched * by outer join */ protected static final int countCollectionPersisters(List associations) throws MappingException { int result = 0; Iterator iter = associations.iterator(); while ( iter.hasNext() ) { OuterJoinableAssociation oj = (OuterJoinableAssociation) iter.next(); if ( oj.getJoinType()==JoinFragment.LEFT_OUTER_JOIN && oj.getJoinable().isCollection() ) { result++; } } return result; }