org.hibernate.loader.entity
Class EntityLoader

java.lang.Object
  extended byorg.hibernate.loader.Loader
      extended byorg.hibernate.loader.BasicLoader
          extended byorg.hibernate.loader.OuterJoinLoader
              extended byorg.hibernate.loader.AbstractEntityLoader
                  extended byorg.hibernate.loader.entity.EntityLoader
All Implemented Interfaces:
UniqueEntityLoader

public class EntityLoader
extends AbstractEntityLoader
implements UniqueEntityLoader

Load an entity using outerjoin fetching to fetch associated entities.
The EntityPersister must implement Loadable. For other entities, create a customized subclass of Loader.

Author:
Gavin King
See Also:
SimpleEntityLoader

Field Summary
 
Fields inherited from class org.hibernate.loader.OuterJoinLoader
aliases, collectionOwners, collectionPersisters, collectionSuffixes, lockModeArray, ownerAssociationType, owners, persisters, sql, suffixes
 
Fields inherited from class org.hibernate.loader.BasicLoader
NO_SUFFIX
 
Constructor Summary
EntityLoader(OuterJoinLoadable persister, int batchSize, LockMode lockMode, SessionFactoryImplementor factory, Map enabledFilters)
           
EntityLoader(OuterJoinLoadable persister, LockMode lockMode, SessionFactoryImplementor factory, Map enabledFilters)
           
EntityLoader(OuterJoinLoadable persister, String[] uniqueKey, Type uniqueKeyType, int batchSize, LockMode lockMode, SessionFactoryImplementor factory, Map enabledFilters)
           
 
Method Summary
 String getComment()
           
protected  Object getResultColumnOrRow(Object[] row, ResultSet rs, SessionImplementor session)
          Get the actual object that is returned in the user-visible result list.
protected  boolean isJoinedFetchEnabled(AssociationType type, FetchMode config)
          Disable outer join fetching if this loader obtains an upgrade lock mode
protected  boolean isSingleRowLoader()
          Return false is this loader is a batch entity loader
 Object load(Serializable id, Object optionalObject, SessionImplementor session)
          Load an entity instance.
 Object loadByUniqueKey(SessionImplementor session, Object key)
           
 
Methods inherited from class org.hibernate.loader.AbstractEntityLoader
getAlias, getPersister, getWhereFragment, initAll, initProjection, toString
 
Methods inherited from class org.hibernate.loader.OuterJoinLoader
countCollectionPersisters, countEntityPersisters, generateRootAlias, generateTableAlias, getAliases, getCollectionOwners, getCollectionPersisters, getCollectionSuffixes, getDialect, getEnabledFilters, getEntityPersisters, getJoinType, getJoinType, getLockModes, getOwnerAssociationTypes, getOwners, getSQLString, getSuffixes, initPersisters, isDuplicateAssociation, isDuplicateAssociation, isJoinable, isJoinedFetchEnabledInMapping, isTooDeep, mergeOuterJoins, orderBy, orderBy, selectString, walkCollectionTree, walkEntityTree, whereString
 
Methods inherited from class org.hibernate.loader.BasicLoader
generateSuffixes, generateSuffixes, getCollectionAliases, getEntityAliases, postInstantiate
 
Methods inherited from class org.hibernate.loader.Loader
applyLocks, bindNamedParameters, bindPositionalParameters, doList, getEntityEagerPropertyFetches, getFactory, getQueryIdentifier, getResultList, getResultSet, getResultSet, hasSubselectLoadableCollections, 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

EntityLoader

public EntityLoader(OuterJoinLoadable persister,
                    LockMode lockMode,
                    SessionFactoryImplementor factory,
                    Map enabledFilters)
             throws MappingException

EntityLoader

public EntityLoader(OuterJoinLoadable persister,
                    int batchSize,
                    LockMode lockMode,
                    SessionFactoryImplementor factory,
                    Map enabledFilters)
             throws MappingException

EntityLoader

public EntityLoader(OuterJoinLoadable persister,
                    String[] uniqueKey,
                    Type uniqueKeyType,
                    int batchSize,
                    LockMode lockMode,
                    SessionFactoryImplementor factory,
                    Map enabledFilters)
             throws MappingException
Method Detail

load

public Object load(Serializable id,
                   Object optionalObject,
                   SessionImplementor session)
            throws HibernateException
Description copied from interface: UniqueEntityLoader
Load an entity instance. If optionalObject is supplied, load the entity state into the given (uninitialized) object.

Specified by:
load in interface UniqueEntityLoader
Throws:
HibernateException

loadByUniqueKey

public Object loadByUniqueKey(SessionImplementor session,
                              Object key)
                       throws HibernateException
Throws:
HibernateException

getResultColumnOrRow

protected Object getResultColumnOrRow(Object[] row,
                                      ResultSet rs,
                                      SessionImplementor session)
                               throws SQLException,
                                      HibernateException
Description copied from class: Loader
Get the actual object that is returned in the user-visible result list. This empty implementation merely returns its first argument. This is overridden by some subclasses.

Overrides:
getResultColumnOrRow in class Loader
Throws:
SQLException
HibernateException

isSingleRowLoader

protected boolean isSingleRowLoader()
Description copied from class: Loader
Return false is this loader is a batch entity loader

Overrides:
isSingleRowLoader in class Loader

isJoinedFetchEnabled

protected boolean isJoinedFetchEnabled(AssociationType type,
                                       FetchMode config)
Disable outer join fetching if this loader obtains an upgrade lock mode

Overrides:
isJoinedFetchEnabled in class AbstractEntityLoader

getComment

public String getComment()
Specified by:
getComment in class AbstractEntityLoader