|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hibernate.loader.Loader
org.hibernate.loader.BasicLoader
org.hibernate.loader.OuterJoinLoader
Implements logic for walking a tree of associated classes. Generates an SQL select string containing all properties of those classes. Tables are joined using an ANSI-style left outer join.
Field Summary | |
protected String[] |
aliases
|
protected int[] |
collectionOwners
|
protected CollectionPersister[] |
collectionPersisters
|
protected String[] |
collectionSuffixes
|
protected LockMode[] |
lockModeArray
|
protected EntityType[] |
ownerAssociationType
|
protected int[] |
owners
|
protected Loadable[] |
persisters
|
protected String |
sql
|
protected String[] |
suffixes
|
Fields inherited from class org.hibernate.loader.BasicLoader |
NO_SUFFIX |
Constructor Summary | |
OuterJoinLoader(SessionFactoryImplementor factory,
Map enabledFilters)
|
Method Summary | |
protected static int |
countCollectionPersisters(List associations)
Count the number of instances of Joinable which are actually also instances of PersistentCollection which are being fetched by outer join |
protected static int |
countEntityPersisters(List associations)
Count the number of instances of Joinable which are actually also instances of Loadable, or are one-to-many associations |
protected String |
generateRootAlias(String description)
|
protected String |
generateTableAlias(int n,
String path,
Joinable joinable)
|
protected String[] |
getAliases()
Get the SQL table aliases of entities whose associations are subselect-loadable, returning null if this loader does not support subselect loading |
protected int[] |
getCollectionOwners()
Get the index of the entity that owns the collection, or -1 if there is no owner in the query results (ie. |
protected CollectionPersister[] |
getCollectionPersisters()
An (optional) persister for a collection to be initialized; only collection loaders return a non-null value |
protected String[] |
getCollectionSuffixes()
|
protected Dialect |
getDialect()
|
Map |
getEnabledFilters()
|
protected Loadable[] |
getEntityPersisters()
An array of persisters of entity classes contained in each row of results; implemented by all subclasses |
protected int |
getJoinType(AssociationType type,
FetchMode config,
String path,
Set visitedAssociations,
String lhsTable,
String[] lhsColumns,
boolean nullable,
int currentDepth)
Get the join type (inner, outer, etc) or -1 if the association should not be joined. |
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 |
protected LockMode[] |
getLockModes(Map lockModes)
What lock mode does this load entities with? |
protected EntityType[] |
getOwnerAssociationTypes()
An array of unique key property names by which the corresponding entities are referenced by other entities in the result set |
protected int[] |
getOwners()
An array of indexes of the entity that owns a one-to-one association to the entity at the given index (-1 if there is no "owner") |
protected String |
getSQLString()
The SQL query string to be called; implemented by all subclasses |
protected String[] |
getSuffixes()
|
protected void |
initPersisters(List associations,
LockMode lockMode)
|
protected boolean |
isDuplicateAssociation(Set visitedAssociationKeys,
String foreignKeyTable,
String[] foreignKeyColumns)
Used to detect circularities in the joined graph |
protected boolean |
isDuplicateAssociation(Set visitedAssociationKeys,
String lhsTable,
String[] lhsColumnNames,
AssociationType type)
Used to detect circularities in the joined graph |
protected boolean |
isJoinable(int joinType,
Set visitedAssociationKeys,
String lhsTable,
String[] lhsColumnNames,
AssociationType type,
int depth)
Should we join this association? |
protected boolean |
isJoinedFetchEnabled(AssociationType type,
FetchMode config)
Override on subclasses to enable or suppress joining of certain association types |
protected boolean |
isJoinedFetchEnabledInMapping(FetchMode config,
AssociationType type)
Does the mapping, and Hibernate default semantics, specify that this association should be fetched by outer joining |
protected boolean |
isTooDeep(int currentDepth)
|
protected JoinFragment |
mergeOuterJoins(List associations)
Generate a sequence of LEFT OUTER JOIN clauses for the given associations. |
protected static String |
orderBy(List associations)
Get the order by string required for collection fetching |
protected String |
orderBy(List associations,
String orderBy)
|
protected String |
selectString(List associations)
Generate a select list of columns containing all properties of the entity classes |
protected List |
walkCollectionTree(QueryableCollection persister,
String alias)
For a collection role, return a list of associations to be fetched by outerjoin |
protected List |
walkEntityTree(OuterJoinLoadable persister,
String alias)
For an entity class, return a list of associations to be fetched by outerjoin |
protected StringBuffer |
whereString(String alias,
String[] columnNames,
int batchSize,
String subquery)
Render the where condition for a (batch) load by identifier / collection key |
Methods inherited from class org.hibernate.loader.BasicLoader |
generateSuffixes, generateSuffixes, getCollectionAliases, getEntityAliases, postInstantiate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected Loadable[] persisters
protected CollectionPersister[] collectionPersisters
protected int[] collectionOwners
protected String[] aliases
protected LockMode[] lockModeArray
protected int[] owners
protected EntityType[] ownerAssociationType
protected String sql
protected String[] suffixes
protected String[] collectionSuffixes
Constructor Detail |
public OuterJoinLoader(SessionFactoryImplementor factory, Map enabledFilters)
Method Detail |
protected final Dialect getDialect()
protected boolean isJoinedFetchEnabled(AssociationType type, FetchMode config)
protected boolean isDuplicateAssociation(Set visitedAssociationKeys, String lhsTable, String[] lhsColumnNames, AssociationType type)
protected boolean isJoinable(int joinType, Set visitedAssociationKeys, String lhsTable, String[] lhsColumnNames, AssociationType type, int depth)
protected boolean isDuplicateAssociation(Set visitedAssociationKeys, String foreignKeyTable, String[] foreignKeyColumns)
protected boolean isTooDeep(int currentDepth)
protected int getJoinType(AssociationType type, FetchMode config, String path, Set visitedAssociations, String lhsTable, String[] lhsColumns, boolean nullable, int currentDepth) throws MappingException
MappingException
protected int getJoinType(boolean nullable, int currentDepth)
protected final List walkEntityTree(OuterJoinLoadable persister, String alias) throws MappingException
MappingException
protected final List walkCollectionTree(QueryableCollection persister, String alias) throws MappingException
MappingException
protected boolean isJoinedFetchEnabledInMapping(FetchMode config, AssociationType type) throws MappingException
MappingException
protected final String selectString(List associations) throws MappingException
MappingException
protected String[] getSuffixes()
getSuffixes
in class BasicLoader
protected String[] getCollectionSuffixes()
getCollectionSuffixes
in class BasicLoader
protected String generateTableAlias(int n, String path, Joinable joinable)
protected String generateRootAlias(String description)
protected final JoinFragment mergeOuterJoins(List associations) throws MappingException
MappingException
protected static final int countEntityPersisters(List associations) throws MappingException
MappingException
protected static final int countCollectionPersisters(List associations) throws MappingException
MappingException
protected static final String orderBy(List associations) throws MappingException
MappingException
protected StringBuffer whereString(String alias, String[] columnNames, int batchSize, String subquery)
protected final String getSQLString()
Loader
getSQLString
in class Loader
protected final Loadable[] getEntityPersisters()
Loader
getEntityPersisters
in class Loader
protected int[] getOwners()
Loader
getOwners
in class Loader
protected EntityType[] getOwnerAssociationTypes()
Loader
getOwnerAssociationTypes
in class Loader
protected LockMode[] getLockModes(Map lockModes)
Loader
getLockModes
in class Loader
lockModes
- a collection of lock modes specified dynamically via the Query interfacepublic Map getEnabledFilters()
protected void initPersisters(List associations, LockMode lockMode) throws MappingException
MappingException
protected final String[] getAliases()
Loader
getAliases
in class Loader
protected final CollectionPersister[] getCollectionPersisters()
Loader
getCollectionPersisters
in class Loader
protected final int[] getCollectionOwners()
Loader
getCollectionOwners
in class Loader
protected String orderBy(List associations, String orderBy)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |