protected final Dialect getDialect() { return getFactory().getDialect(); }
associationType, alias, propertyNumber, persister, getFactory() ); associationType, propertyNumber, persister, getFactory() ); String lhsTable = JoinHelper.getLHSTableName(associationType, propertyNumber, persister); String subpath = subPath( path, persister.getSubclassPropertyName(propertyNumber) ); int joinType = getJoinType( associationType, persister.getFetchMode(propertyNumber), currentDepth ); addAssociationToJoinTreeIfNecessary( associationType, aliasedLhsColumns,
throws MappingException { Joinable joinable = type.getAssociatedJoinable( getFactory() ); String subalias = generateTableAlias( associations.size()+1, //before adding to collection! path, subalias, joinType, getFactory(), enabledFilters ); if ( !joinable.isCollection() ) { if (joinable instanceof OuterJoinLoadable) { walkEntityTree( (OuterJoinLoadable) joinable, subalias, walkCollectionTree( (QueryableCollection) joinable, subalias,
/** * Should we join this association? */ protected boolean isJoinable( final int joinType, final Set visitedAssociationKeys, final String lhsTable, final String[] lhsColumnNames, final AssociationType type, final int depth ) { if (joinType<0) return false; if (joinType==JoinFragment.INNER_JOIN) return true; Integer maxFetchDepth = getFactory().getSettings().getMaximumFetchDepth(); final boolean tooDeep = maxFetchDepth!=null && depth >= maxFetchDepth.intValue(); return !tooDeep && !isDuplicateAssociation( visitedAssociationKeys, lhsTable, lhsColumnNames, type ); }
walkEntityTree( (OuterJoinLoadable) persister.getElementPersister(), alias, final int joinType = getJoinType( associationType, persister.getFetchMode(), currentDepth - 1 ); addAssociationToJoinTreeIfNecessary( associationType, aliasedLhsColumns, walkCompositeElementTree( (AbstractComponentType) type, persister.getElementColumnNames(),
protected void initPersisters(final List associations, final LockMode lockMode) throws MappingException { final int joins = countEntityPersisters(associations); final int collections = countCollectionPersisters(associations); collectionSuffixes = generateSuffixes( joins + 1, collections );
addAssociationToJoinTree( type, aliasedLhsColumns,
associationType, alias, propertyNumber, begin, persister, getFactory() ); associationType, propertyNumber, begin, persister, getFactory() ); String lhsTable = JoinHelper.getLHSTableName(associationType, propertyNumber, persister); String subpath = subPath( path, propertyNames[i] ); final boolean[] propertyNullability = componentType.getPropertyNullability(); final int joinType = getJoinType( associationType, componentType.getFetchMode(i), currentDepth ); addAssociationToJoinTreeIfNecessary( associationType, aliasedLhsColumns, String subpath = subPath( path, propertyNames[i] ); walkComponentTree( (AbstractComponentType) types[i], propertyNumber, begin+=types[i].getColumnSpan( getFactory() );
/** * Used to detect circularities in the joined graph */ protected boolean isDuplicateAssociation( final Set visitedAssociationKeys, final String lhsTable, final String[] lhsColumnNames, final AssociationType type ) { final String foreignKeyTable; final String[] foreignKeyColumns; if ( type.getForeignKeyDirection()==ForeignKeyDirection.FOREIGN_KEY_FROM_PARENT ) { foreignKeyTable = lhsTable; foreignKeyColumns = lhsColumnNames; } else { foreignKeyTable = type.getAssociatedJoinable( getFactory() ).getTableName(); foreignKeyColumns = JoinHelper.getRHSColumnNames( type, getFactory() ); } return isDuplicateAssociation(visitedAssociationKeys, foreignKeyTable, foreignKeyColumns); }
int begin = 0; for ( int i=0; i <types.length; i++ ) { int length = types[i].getColumnSpan( getFactory() ); String[] lhsColumns = ArrayHelper.slice(cols, begin, length); String subpath = subPath( path, propertyNames[i] ); final boolean[] propertyNullability = compositeType.getPropertyNullability(); final int joinType = getJoinType( associationType, compositeType.getFetchMode(i), currentDepth ); addAssociationToJoinTreeIfNecessary( associationType, aliasedLhsColumns, String subpath = subPath( path, propertyNames[i] ); walkCompositeElementTree( (AbstractComponentType) types[i], lhsColumns,
protected final Dialect getDialect() { return getFactory().getDialect(); }
protected final Dialect getDialect() { return getFactory().getDialect(); }
protected final Dialect getDialect() { return getFactory().getDialect(); }
protected final Dialect getDialect() { return getFactory().getDialect(); }
protected boolean isTooDeep(int currentDepth) { Integer maxFetchDepth = getFactory().getSettings().getMaximumFetchDepth(); return maxFetchDepth!=null && currentDepth >= maxFetchDepth.intValue(); }
/** * Does the mapping, and Hibernate default semantics, specify that * this association should be fetched by outer joining */ protected boolean isJoinedFetchEnabledInMapping(FetchMode config, AssociationType type) throws MappingException { if ( !type.isEntityType() && !type.isCollectionType() ) { return false; } else { if (config==FetchMode.JOIN) return true; if (config==FetchMode.SELECT) return false; if ( type.isEntityType() ) { //TODO: look at the owning property and check that it // isn't lazy (by instrumentation) EntityType entityType =(EntityType) type; EntityPersister persister = getFactory().getEntityPersister( entityType.getAssociatedEntityName() ); return !persister.hasProxy(); } else { return false; } } }