|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.hibernate.loader.Loader net.sf.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.
Nested Class Summary | |
static class |
OuterJoinLoader.OuterJoinableAssociation
|
Field Summary | |
static int |
AUTO
|
protected Loadable[] |
classPersisters
|
static int |
EAGER
|
static int |
LAZY
|
protected LockMode[] |
lockModeArray
|
protected int[] |
owners
|
protected String |
sql
|
protected String[] |
suffixes
|
Fields inherited from class net.sf.hibernate.loader.Loader |
NO_SUFFIX |
Constructor Summary | |
OuterJoinLoader(Dialect dialect)
|
Method Summary | |
protected static boolean |
containsCollectionPersister(List associations)
|
protected static int |
countClassPersisters(List associations)
Count the number of instances of Joinable which are actually also instances of Loadable, or are one-to-many associations |
protected LockMode[] |
createLockModeArray(int length,
LockMode lockMode)
|
protected String |
generateRootAlias(String tableName)
|
protected String |
generateTableAlias(String className,
int n,
String path,
boolean isLinkTable)
|
protected CollectionPersister |
getCollectionPersister()
An (optional) persister for a collection to be initialized; only collection loaders return a non-null value |
protected int |
getJoinType(AssociationType type,
int config,
String path,
String table,
String[] foreignKeyColumns,
SessionFactoryImplementor factory)
|
protected LockMode[] |
getLockModes(Map lockModes)
What lock mode does this load entities with? |
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 Loadable[] |
getPersisters()
An array of persisters of entity classes contained in each row of results; implemented by all subclasses |
protected String |
getSQLString()
The SQL query string to be called; implemented by all subclasses |
protected String[] |
getSuffixes()
The suffix identifies a particular column of results in the SQL ResultSet; implemented by all subclasses |
protected boolean |
isJoinedFetchEnabled(Type type,
boolean mappingDefault,
String path,
String table,
String[] foreignKeyColumns)
Override on subclasses to enable or suppress joining of some associations, especially in the case of dynamic fetch settings |
protected boolean |
isJoinedFetchEnabledByDefault(int config,
AssociationType type,
SessionFactoryImplementor factory)
Does the mapping, and Hibernate default semantics, specify that this association should be fetched by outer joining |
protected JoinFragment |
mergeOuterJoins(List associations)
Generate a sequence of LEFT OUTER JOIN clauses for the given associations. |
protected String |
selectString(List associations,
SessionFactoryImplementor factory)
Generate a select list of columns containing all properties of the entity classes |
protected int |
toOwner(OuterJoinLoader.OuterJoinableAssociation oj,
int joins,
boolean dontIgnore)
|
protected List |
walkCollectionTree(QueryableCollection persister,
String alias,
SessionFactoryImplementor factory)
For a collection role, return a list of associations to be fetched by outerjoin |
protected List |
walkTree(OuterJoinLoadable persister,
String alias,
SessionFactoryImplementor factory)
For an entity class, return a list of associations to be fetched by outerjoin |
protected static StringBuffer |
whereString(String alias,
String[] columnNames,
int batchSize)
Render the where condition for a (batch) load by identifier / collection key |
Methods inherited from class net.sf.hibernate.loader.Loader |
applyLocks, bindNamedParameters, bindPositionalParameters, doList, generateAlias, generateSuffixes, getCollectionOwner, getResultColumnOrRow, getResultList, getResultSet, isSingleRowLoader, list, loadCollection, loadCollectionBatch, loadEntity, loadEntityBatch, loadSingleRow, postInstantiate, prepareQueryStatement, upgradeLocks |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int EAGER
public static final int AUTO
public static final int LAZY
protected Loadable[] classPersisters
protected LockMode[] lockModeArray
protected int[] owners
protected String sql
protected String[] suffixes
Constructor Detail |
public OuterJoinLoader(Dialect dialect)
Method Detail |
protected boolean isJoinedFetchEnabled(Type type, boolean mappingDefault, String path, String table, String[] foreignKeyColumns)
protected int getJoinType(AssociationType type, int config, String path, String table, String[] foreignKeyColumns, SessionFactoryImplementor factory) throws MappingException
MappingException
protected final List walkTree(OuterJoinLoadable persister, String alias, SessionFactoryImplementor factory) throws MappingException
MappingException
protected final List walkCollectionTree(QueryableCollection persister, String alias, SessionFactoryImplementor factory) throws MappingException
MappingException
protected boolean isJoinedFetchEnabledByDefault(int config, AssociationType type, SessionFactoryImplementor factory) throws MappingException
MappingException
protected final String getSQLString()
Loader
getSQLString
in class Loader
protected final Loadable[] getPersisters()
Loader
getPersisters
in class Loader
protected final String selectString(List associations, SessionFactoryImplementor factory) throws MappingException
MappingException
protected String[] getSuffixes()
Loader
getSuffixes
in class Loader
protected String generateTableAlias(String className, int n, String path, boolean isLinkTable)
protected String generateRootAlias(String tableName)
protected CollectionPersister getCollectionPersister()
Loader
getCollectionPersister
in class Loader
protected final JoinFragment mergeOuterJoins(List associations)
protected static final int countClassPersisters(List associations)
protected static boolean containsCollectionPersister(List associations)
protected LockMode[] getLockModes(Map lockModes)
Loader
getLockModes
in class Loader
lockModes
- a collection of lock modes specified dynamically via the Query interfaceprotected LockMode[] createLockModeArray(int length, LockMode lockMode)
protected static StringBuffer whereString(String alias, String[] columnNames, int batchSize)
protected int[] getOwners()
Loader
protected int toOwner(OuterJoinLoader.OuterJoinableAssociation oj, int joins, boolean dontIgnore)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |