站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Hibernate 2.1.8 正式版 API 英文文档

EntityLoader (Hibernate API Documentation) - Hibernate 2.1.8 正式版 API 英文文档


net.sf.hibernate.loader
Class EntityLoader

java.lang.Object
  extended bynet.sf.hibernate.loader.Loader
      extended bynet.sf.hibernate.loader.OuterJoinLoader
          extended bynet.sf.hibernate.loader.AbstractEntityLoader
              extended bynet.sf.hibernate.loader.EntityLoader
All Implemented Interfaces:
UniqueEntityLoader

public class EntityLoader
extends AbstractEntityLoader
implements UniqueEntityLoader

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

Author:
Gavin King
See Also:
SimpleEntityLoader

Nested Class Summary
 
Nested classes inherited from class net.sf.hibernate.loader.OuterJoinLoader
OuterJoinLoader.OuterJoinableAssociation
 
Field Summary
 
Fields inherited from class net.sf.hibernate.loader.OuterJoinLoader
AUTO, classPersisters, EAGER, LAZY, lockModeArray, owners, sql, suffixes
 
Fields inherited from class net.sf.hibernate.loader.Loader
NO_SUFFIX
 
Constructor Summary
EntityLoader(OuterJoinLoadable persister, int batchSize, SessionFactoryImplementor factory)
           
EntityLoader(OuterJoinLoadable persister, String[] uniqueKey, Type uniqueKeyType, int batchSize, SessionFactoryImplementor factory)
           
 
Method Summary
protected  Object getResultColumnOrRow(Object[] row, ResultSet rs, SessionImplementor session)
          Get the actual object that is returned in the user-visible result list.
protected  boolean isSingleRowLoader()
          Return false is this loader is a batch entity loader
 Object load(SessionImplementor session, Serializable id, Object optionalObject)
          Load an entity instance.
 Object loadByUniqueKey(SessionImplementor session, Serializable id)
           
 
Methods inherited from class net.sf.hibernate.loader.AbstractEntityLoader
addAllToPropertySpaces, addToPropertySpaces, getAlias, getCollectionOwner, getCollectionPersister, getEntityAliases, getPersister, getWhereFragment, initClassPersisters, initStatementString, isJoinedFetchEnabled, renderStatement, setAlias, toString
 
Methods inherited from class net.sf.hibernate.loader.OuterJoinLoader
containsCollectionPersister, countClassPersisters, createLockModeArray, generateRootAlias, generateTableAlias, getJoinType, getLockModes, getOwners, getPersisters, getSQLString, getSuffixes, isJoinedFetchEnabledByDefault, mergeOuterJoins, selectString, toOwner, walkCollectionTree, walkTree, whereString
 
Methods inherited from class net.sf.hibernate.loader.Loader
applyLocks, bindNamedParameters, bindPositionalParameters, doList, generateAlias, generateSuffixes, getResultList, getResultSet, list, loadCollection, loadCollectionBatch, loadEntity, loadEntityBatch, loadSingleRow, postInstantiate, prepareQueryStatement, 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,
                    int batchSize,
                    SessionFactoryImplementor factory)
             throws MappingException

EntityLoader

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

load

public Object load(SessionImplementor session,
                   Serializable id,
                   Object optionalObject)
            throws HibernateException,
                   SQLException
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
SQLException

loadByUniqueKey

public Object loadByUniqueKey(SessionImplementor session,
                              Serializable id)
                       throws HibernateException,
                              SQLException
Throws:
HibernateException
SQLException

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