Walks the metamodel, searching for joins, and collecting
together information needed by OuterJoinLoader.
aliases
protected String[] aliases
associations
protected final List associations
collectionOwners
protected int[] collectionOwners
collectionSuffixes
protected String[] collectionSuffixes
lockModeArray
protected LockMode[] lockModeArray
ownerAssociationTypes
protected EntityType[] ownerAssociationTypes
owners
protected int[] owners
persisters
protected Loadable[] persisters
suffixes
protected String[] suffixes
countCollectionPersisters
protected static final int countCollectionPersisters(List associations)
throws MappingException
Count the number of instances of Joinable which are actually
also instances of PersistentCollection which are being fetched
by outer join
countEntityPersisters
protected static final int countEntityPersisters(List associations)
throws MappingException
Count the number of instances of Joinable which are actually
also instances of Loadable, or are one-to-many associations
generateRootAlias
protected String generateRootAlias(String description)
generateTableAlias
protected String generateTableAlias(int n,
String path,
Joinable joinable)
getAliases
public String[] getAliases()
getCollectionOwners
public int[] getCollectionOwners()
getCollectionSuffixes
public String[] getCollectionSuffixes()
getDialect
protected Dialect getDialect()
getEnabledFilters
protected Map getEnabledFilters()
getJoinType
protected int getJoinType(boolean nullable,
int currentDepth)
Use an inner join if it is a non-null association and this
is the "first" join in a series
getJoinType
protected int getJoinType(AssociationType type,
FetchMode config,
String path,
String lhsTable,
String[] lhsColumns,
boolean nullable,
int currentDepth,
CascadeStyle cascadeStyle)
throws MappingException
Get the join type (inner, outer, etc) or -1 if the
association should not be joined. Override on
subclasses.
getLockModeArray
public LockMode[] getLockModeArray()
getOwnerAssociationTypes
public EntityType[] getOwnerAssociationTypes()
getOwners
public int[] getOwners()
getPersisters
public Loadable[] getPersisters()
getSQLString
public String getSQLString()
getSuffixes
public String[] getSuffixes()
isDuplicateAssociation
protected boolean isDuplicateAssociation(String foreignKeyTable,
String[] foreignKeyColumns)
Used to detect circularities in the joined graph, note that
this method is side-effecty
isDuplicateAssociation
protected boolean isDuplicateAssociation(String lhsTable,
String[] lhsColumnNames,
AssociationType type)
Used to detect circularities in the joined graph, note that
this method is side-effecty
isJoinable
protected boolean isJoinable(int joinType,
Set visitedAssociationKeys,
String lhsTable,
String[] lhsColumnNames,
AssociationType type,
int depth)
Should we join this association?
isJoinedFetchEnabled
protected boolean isJoinedFetchEnabled(AssociationType type,
FetchMode config,
CascadeStyle cascadeStyle)
Override on subclasses to enable or suppress joining
of certain association types
isJoinedFetchEnabledInMapping
protected boolean isJoinedFetchEnabledInMapping(FetchMode config,
AssociationType type)
throws MappingException
Does the mapping, and Hibernate default semantics, specify that
this association should be fetched by outer joining
isTooDeep
protected boolean isTooDeep(int currentDepth)
isTooManyCollections
protected boolean isTooManyCollections()
mergeOrderings
protected static String mergeOrderings(String ordering1,
String ordering2)
mergeOuterJoins
protected final JoinFragment mergeOuterJoins(List associations)
throws MappingException
Generate a sequence of LEFT OUTER JOIN clauses for the given associations.
orderBy
protected static final String orderBy(List associations)
throws MappingException
Get the order by string required for collection fetching
orderBy
protected String orderBy(List associations,
String orderBy)
selectString
protected final String selectString(List associations)
throws MappingException
Generate a select list of columns containing all properties of the entity classes
setAliases
public void setAliases(String[] aliases)
setCollectionOwners
public void setCollectionOwners(int[] collectionOwners)
setCollectionPersisters
public void setCollectionPersisters(CollectionPersister[] collectionPersisters)
setCollectionSuffixes
public void setCollectionSuffixes(String[] collectionSuffixes)
setLockModeArray
public void setLockModeArray(LockMode[] lockModeArray)
setOwnerAssociationTypes
public void setOwnerAssociationTypes(EntityType[] ownerAssociationType)
setOwners
public void setOwners(int[] owners)
setPersisters
public void setPersisters(Loadable[] persisters)
setSql
public void setSql(String sql)
setSuffixes
public void setSuffixes(String[] suffixes)
walkCollectionTree
protected final void walkCollectionTree(QueryableCollection persister,
String alias)
throws MappingException
For a collection role, return a list of associations to be fetched by outerjoin
walkEntityTree
protected final void walkEntityTree(OuterJoinLoadable persister,
String alias)
throws MappingException
For an entity class, return a list of associations to be fetched by outerjoin
whereString
protected StringBuffer whereString(String alias,
String[] columnNames,
int batchSize)
Render the where condition for a (batch) load by identifier / collection key