org.hibernate.loader

Class OuterJoinLoader

Known Direct Subclasses:
AbstractEntityLoader, CollectionElementLoader, CollectionLoader, CriteriaLoader

public abstract class OuterJoinLoader
extends BasicLoader

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.
Author:
Gavin King

Field Summary

protected String[]
aliases
protected int[]
collectionOwners
protected CollectionPersister[]
collectionPersisters
protected String[]
collectionSuffixes
protected LockMode[]
lockModeArray
protected EntityType[]
ownerAssociationTypes
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 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 LockMode[]
getLockModes(Map lockModes)
What lock mode does this load entities with?
protected EntityType[]
getOwnerAssociationTypes()
An array of the owner types corresponding to the Loader.getOwners() returns.
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
initFromWalker(JoinWalker walker)

Methods inherited from class org.hibernate.loader.BasicLoader

generateSuffixes, generateSuffixes, getCollectionAliases, getCollectionSuffixes, getEntityAliases, getSuffixes, postInstantiate

Methods inherited from class org.hibernate.loader.Loader

applyLocks, autoDiscoverTypes, bindNamedParameters, bindParameterValues, bindPositionalParameters, checkScrollability, doList, getAliases, getCollectionAliases, getCollectionOwners, getCollectionPersisters, getEntityAliases, getEntityEagerPropertyFetches, getEntityPersisters, getFactory, getLockModes, getNamedParameterLocs, getOwnerAssociationTypes, getOwners, getQueryIdentifier, getResultColumnOrRow, getResultList, getResultSet, getSQLString, hasSubselectLoadableCollections, isSingleRowLoader, isSubselectLoadingEnabled, list, loadCollection, loadCollectionBatch, loadCollectionSubselect, loadEntity, loadEntity, loadEntityBatch, loadSequentialRowsForward, loadSequentialRowsReverse, loadSingleRow, needsFetchingScroll, postInstantiate, prepareQueryStatement, preprocessSQL, scroll, toString, upgradeLocks

Field Details

aliases

protected String[] aliases

collectionOwners

protected int[] collectionOwners

collectionPersisters

protected CollectionPersister[] collectionPersisters

collectionSuffixes

protected String[] collectionSuffixes

lockModeArray

protected LockMode[] lockModeArray

ownerAssociationTypes

protected EntityType[] ownerAssociationTypes

owners

protected int[] owners

persisters

protected Loadable[] persisters

sql

protected String sql

suffixes

protected String[] suffixes

Constructor Details

OuterJoinLoader

public OuterJoinLoader(SessionFactoryImplementor factory,
                       Map enabledFilters)

Method Details

getAliases

protected final String[] getAliases()
Get the SQL table aliases of entities whose associations are subselect-loadable, returning null if this loader does not support subselect loading
Overrides:
getAliases in interface Loader

getCollectionOwners

protected final int[] getCollectionOwners()
Get the index of the entity that owns the collection, or -1 if there is no owner in the query results (ie. in the case of a collection initializer) or no collection.
Overrides:
getCollectionOwners in interface Loader

getCollectionPersisters

protected final CollectionPersister[] getCollectionPersisters()
An (optional) persister for a collection to be initialized; only collection loaders return a non-null value
Overrides:
getCollectionPersisters in interface Loader

getCollectionSuffixes

protected String[] getCollectionSuffixes()
Overrides:
getCollectionSuffixes in interface BasicLoader

getDialect

protected final Dialect getDialect()

getEnabledFilters

public Map getEnabledFilters()

getEntityPersisters

protected final Loadable[] getEntityPersisters()
An array of persisters of entity classes contained in each row of results; implemented by all subclasses
Overrides:
getEntityPersisters in interface Loader
Returns:
The entity persisters.

getLockModes

protected LockMode[] getLockModes(Map lockModes)
What lock mode does this load entities with?
Overrides:
getLockModes in interface Loader
Parameters:
lockModes - a collection of lock modes specified dynamically via the Query interface

getOwnerAssociationTypes

protected EntityType[] getOwnerAssociationTypes()
An array of the owner types corresponding to the Loader.getOwners() returns. Indices indicating no owner would be null here.
Overrides:
getOwnerAssociationTypes in interface Loader
Returns:
The types for the owners.

getOwners

protected int[] getOwners()
Overrides:
getOwners in interface Loader
Returns:
The owner indicators (see discussion above).

getSQLString

protected final String getSQLString()
The SQL query string to be called; implemented by all subclasses
Overrides:
getSQLString in interface Loader
Returns:
The sql command this loader should use to get its ResultSet.

getSuffixes

protected String[] getSuffixes()
Overrides:
getSuffixes in interface BasicLoader

initFromWalker

protected void initFromWalker(JoinWalker walker)