org.hibernate.loader.collection
Class OneToManyLoader

java.lang.Object
  extended byorg.hibernate.loader.Loader
      extended byorg.hibernate.loader.BasicLoader
          extended byorg.hibernate.loader.OuterJoinLoader
              extended byorg.hibernate.loader.collection.OneToManyLoader
All Implemented Interfaces:
CollectionInitializer

public class OneToManyLoader
extends OuterJoinLoader
implements CollectionInitializer

Loads one-to-many associations

The collection persister must implement QueryableCOllection. For other collections, create a customized subclass of Loader.

Author:
Gavin King
See Also:
CollectionLoader

Field Summary
 
Fields inherited from class org.hibernate.loader.OuterJoinLoader
lockModeArray, ownerAssociationType, owners, persisters, sql, suffixes
 
Fields inherited from class org.hibernate.loader.BasicLoader
NO_SUFFIX
 
Constructor Summary
OneToManyLoader(QueryableCollection collPersister, int batchSize, SessionFactoryImplementor factory, Map enabledFilters)
           
OneToManyLoader(QueryableCollection collPersister, int batchSize, String subquery, SessionFactoryImplementor factory, Map enabledFilters)
           
OneToManyLoader(QueryableCollection collPersister, SessionFactoryImplementor session, Map enabledFilters)
           
 
Method Summary
protected  CollectionPersister getCollectionPersister()
          An (optional) persister for a collection to be initialized; only collection loaders return a non-null value
protected  Type getKeyType()
           
 void initialize(Serializable id, SessionImplementor session)
          Initialize the given collection
protected  boolean isDuplicateAssociation(Set visitedAssociationKeys, String foreignKeyTable, String[] foreignKeyColumns)
          Used to detect circularities in the joined graph
 String toString()
           
 
Methods inherited from class org.hibernate.loader.OuterJoinLoader
containsCollectionPersister, countEntityPersisters, generateRootAlias, generateTableAlias, getDialect, getEnabledFilters, getEntityPersisters, getJoinType, getJoinType, getLockModes, getOwnerAssociationTypes, getOwners, getSQLString, getSuffixes, isDuplicateAssociation, isJoinable, isJoinedFetchEnabled, isJoinedFetchEnabledInMapping, isTooDeep, mergeOuterJoins, selectString, walkCollectionTree, walkEntityTree, whereString
 
Methods inherited from class org.hibernate.loader.BasicLoader
generateSuffixes, getEntityAliases, postInstantiate
 
Methods inherited from class org.hibernate.loader.Loader
applyLocks, bindNamedParameters, bindPositionalParameters, doList, getAliases, getCollectionOwner, getEntityEagerPropertyFetches, getFactory, getQueryIdentifier, getResultColumnOrRow, getResultList, getResultSet, getResultSet, hasSubselectLoadableCollections, isSingleRowLoader, isSubselectLoadingEnabled, list, loadCollection, loadCollectionBatch, loadCollectionSubselect, loadEntity, loadEntityBatch, loadSingleRow, prepareQueryStatement, preprocessSQL, scroll, upgradeLocks
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OneToManyLoader

public OneToManyLoader(QueryableCollection collPersister,
                       SessionFactoryImplementor session,
                       Map enabledFilters)
                throws MappingException

OneToManyLoader

public OneToManyLoader(QueryableCollection collPersister,
                       int batchSize,
                       SessionFactoryImplementor factory,
                       Map enabledFilters)
                throws MappingException

OneToManyLoader

public OneToManyLoader(QueryableCollection collPersister,
                       int batchSize,
                       String subquery,
                       SessionFactoryImplementor factory,
                       Map enabledFilters)
                throws MappingException
Method Detail

isDuplicateAssociation

protected boolean isDuplicateAssociation(Set visitedAssociationKeys,
                                         String foreignKeyTable,
                                         String[] foreignKeyColumns)
Description copied from class: OuterJoinLoader
Used to detect circularities in the joined graph

Overrides:
isDuplicateAssociation in class OuterJoinLoader

getCollectionPersister

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

Overrides:
getCollectionPersister in class Loader

initialize

public void initialize(Serializable id,
                       SessionImplementor session)
                throws HibernateException
Description copied from interface: CollectionInitializer
Initialize the given collection

Specified by:
initialize in interface CollectionInitializer
Throws:
HibernateException

getKeyType

protected Type getKeyType()

toString

public String toString()
Overrides:
toString in class Loader