org.hibernate.loader
Class OuterJoinLoader

java.lang.Object
  extended by org.hibernate.loader.Loader
      extended by org.hibernate.loader.BasicLoader
          extended by org.hibernate.loader.OuterJoinLoader
Direct Known 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, LoadQueryInfluencers loadQueryInfluencers)
           
 
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()
           
protected  Loadable[] getEntityPersisters()
          An array of persisters of entity classes contained in each row of results; implemented by all subclasses
 LoadQueryInfluencers getLoadQueryInfluencers()
           
protected  LockMode[] getLockModes(LockOptions lockOptions)
          What lock options does this load entities with?
protected  LockOptions getLockOptions()
           
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, getEntityAliases, postInstantiate
 
Methods inherited from class org.hibernate.loader.Loader
applyLocks, applyPostLoadLocks, areResultSetRowsTransformedImmediately, autoDiscoverTypes, bindNamedParameters, bindParameterValues, bindPositionalParameters, checkScrollability, doList, getEntityEagerPropertyFetches, getFactory, getNamedParameterLocs, getQueryIdentifier, getResultColumnOrRow, getResultList, getResultSet, hasSubselectLoadableCollections, isSingleRowLoader, isSubselectLoadingEnabled, list, loadCollection, loadCollectionBatch, loadCollectionSubselect, loadEntity, loadEntity, loadEntityBatch, loadSequentialRowsForward, loadSequentialRowsReverse, loadSingleRow, needsFetchingScroll, prepareQueryStatement, preprocessSQL, resolveResultTransformer, scroll, toString, upgradeLocks
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

persisters

protected Loadable[] persisters

collectionPersisters

protected CollectionPersister[] collectionPersisters

collectionOwners

protected int[] collectionOwners

aliases

protected String[] aliases

lockModeArray

protected LockMode[] lockModeArray

owners

protected int[] owners

ownerAssociationTypes

protected EntityType[] ownerAssociationTypes

sql

protected String sql

suffixes

protected String[] suffixes

collectionSuffixes

protected String[] collectionSuffixes
Constructor Detail

OuterJoinLoader

public OuterJoinLoader(SessionFactoryImplementor factory,
                       LoadQueryInfluencers loadQueryInfluencers)
Method Detail

getDialect

protected final Dialect getDialect()

getSuffixes

protected String[] getSuffixes()
Specified by:
getSuffixes in class BasicLoader

getCollectionSuffixes

protected String[] getCollectionSuffixes()
Specified by:
getCollectionSuffixes in class BasicLoader

getSQLString

protected final String getSQLString()
Description copied from class: Loader
The SQL query string to be called; implemented by all subclasses

Specified by:
getSQLString in class Loader
Returns:
The sql command this loader should use to get its ResultSet.

getEntityPersisters

protected final Loadable[] getEntityPersisters()
Description copied from class: Loader
An array of persisters of entity classes contained in each row of results; implemented by all subclasses

Specified by:
getEntityPersisters in class Loader
Returns:
The entity persisters.

getOwners

protected int[] getOwners()
Description copied from class: Loader
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"). The indexes contained here are relative to the result of Loader.getEntityPersisters().

Overrides:
getOwners in class Loader
Returns:
The owner indicators (see discussion above).

getOwnerAssociationTypes

protected EntityType[] getOwnerAssociationTypes()
Description copied from class: Loader
An array of the owner types corresponding to the Loader.getOwners() returns. Indices indicating no owner would be null here.

Overrides:
getOwnerAssociationTypes in class Loader
Returns:
The types for the owners.

getLockModes

protected LockMode[] getLockModes(LockOptions lockOptions)
Description copied from class: Loader
What lock options does this load entities with?

Specified by:
getLockModes in class Loader
Parameters:
lockOptions - a collection of lock options specified dynamically via the Query interface

getLockOptions

protected LockOptions getLockOptions()

getLoadQueryInfluencers

public LoadQueryInfluencers getLoadQueryInfluencers()

getAliases

protected final String[] getAliases()
Description copied from class: Loader
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 class Loader

getCollectionPersisters

protected final CollectionPersister[] getCollectionPersisters()
Description copied from class: Loader
An (optional) persister for a collection to be initialized; only collection loaders return a non-null value

Overrides:
getCollectionPersisters in class Loader

getCollectionOwners

protected final int[] getCollectionOwners()
Description copied from class: Loader
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 class Loader

initFromWalker

protected void initFromWalker(JoinWalker walker)


Copyright © 2001-2010 Red Hat, Inc. All Rights Reserved.