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

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


net.sf.hibernate.loader
Class SimpleEntityLoader

java.lang.Object
  extended bynet.sf.hibernate.loader.Loader
      extended bynet.sf.hibernate.loader.SimpleEntityLoader
All Implemented Interfaces:
UniqueEntityLoader

public final class SimpleEntityLoader
extends Loader
implements UniqueEntityLoader

Loads entity instances one instance per select, without without any outerjoin fetching.
The ClassPersister must implement Loadable. For other entities, create a customized subclass of Loader.

Author:
Gavin King
See Also:
EntityLoader

Field Summary
 
Fields inherited from class net.sf.hibernate.loader.Loader
NO_SUFFIX
 
Constructor Summary
SimpleEntityLoader(Loadable persister, String sql, LockMode lockMode)
           
 
Method Summary
protected  CollectionPersister getCollectionPersister()
          An (optional) persister for a collection to be initialized; only collection loaders return a non-null value
protected  LockMode[] getLockModes(Map lockModes)
          What lock mode does this load entities with?
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  Loadable[] getPersisters()
          An array of persisters of entity classes contained in each row of results; implemented by all subclasses
protected  Object getResultColumnOrRow(Object[] row, ResultSet rs, SessionImplementor session)
          Get the actual object that is returned in the user-visible result list.
protected  String getSQLString()
          The SQL query string to be called; implemented by all subclasses
protected  String[] getSuffixes()
          The suffix identifies a particular column of results in the SQL ResultSet; implemented by all subclasses
protected  boolean isSingleRowLoader()
          Return false is this loader is a batch entity loader
 Object load(SessionImplementor session, Serializable id, Object object)
          Load an entity instance.
 
Methods inherited from class net.sf.hibernate.loader.Loader
applyLocks, bindNamedParameters, bindPositionalParameters, doList, generateAlias, generateSuffixes, getCollectionOwner, 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, toString, wait, wait, wait
 

Constructor Detail

SimpleEntityLoader

public SimpleEntityLoader(Loadable persister,
                          String sql,
                          LockMode lockMode)
Method Detail

getSQLString

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

Specified by:
getSQLString in class Loader

getPersisters

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

Specified by:
getPersisters in class Loader

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

Specified by:
getCollectionPersister in class Loader

getSuffixes

protected String[] getSuffixes()
Description copied from class: Loader
The suffix identifies a particular column of results in the SQL ResultSet; implemented by all subclasses

Specified by:
getSuffixes in class Loader

load

public Object load(SessionImplementor session,
                   Serializable id,
                   Object object)
            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

getLockModes

protected LockMode[] getLockModes(Map lockModes)
Description copied from class: Loader
What lock mode does this load entities with?

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

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

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")

Specified by:
getOwners in class Loader