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

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


net.sf.hibernate.loader
Class CriteriaLoader

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.CriteriaLoader

public class CriteriaLoader
extends AbstractEntityLoader

A Loader for Criteria queries. Note that criteria queries are more like multi-object load()s than like HQL queries.

Author:
Gavin King

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
CriteriaLoader(OuterJoinLoadable persister, SessionFactoryImplementor factory, CriteriaImpl criteria)
           
 
Method Summary
protected  void addToPropertySpaces(Serializable space)
           
protected  String applyLocks(String sqlSelectString, Map lockModes, Dialect dialect)
          Append FOR UPDATE OF clause, if necessary.
protected  String generateRootAlias(String tableName)
           
protected  String generateTableAlias(String className, int n, String path, boolean isLinkTable)
           
protected  int getJoinType(AssociationType type, int config, String path, String table, String[] foreignKeyColumns, SessionFactoryImplementor factory)
           
protected  LockMode[] getLockModes(Map lockModes)
          What lock mode does this load entities with?
 Set getQuerySpaces()
           
protected  Object getResultColumnOrRow(Object[] row, ResultSet rs, SessionImplementor session)
          Get the actual object that is returned in the user-visible result list.
protected  List getResultList(List results)
           
protected  String getWhereFragment()
          Use the discriminator, to narrow the select to instances of the queried subclass.
 List list(SessionImplementor session)
           
 
Methods inherited from class net.sf.hibernate.loader.AbstractEntityLoader
addAllToPropertySpaces, getAlias, getCollectionOwner, getCollectionPersister, getEntityAliases, getPersister, initClassPersisters, initStatementString, isJoinedFetchEnabled, renderStatement, setAlias, toString
 
Methods inherited from class net.sf.hibernate.loader.OuterJoinLoader
containsCollectionPersister, countClassPersisters, createLockModeArray, getOwners, getPersisters, getSQLString, getSuffixes, isJoinedFetchEnabledByDefault, mergeOuterJoins, selectString, toOwner, walkCollectionTree, walkTree, whereString
 
Methods inherited from class net.sf.hibernate.loader.Loader
bindNamedParameters, bindPositionalParameters, doList, generateAlias, generateSuffixes, getResultSet, isSingleRowLoader, 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

CriteriaLoader

public CriteriaLoader(OuterJoinLoadable persister,
                      SessionFactoryImplementor factory,
                      CriteriaImpl criteria)
               throws HibernateException
Method Detail

list

public List list(SessionImplementor session)
          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

getJoinType

protected int getJoinType(AssociationType type,
                          int config,
                          String path,
                          String table,
                          String[] foreignKeyColumns,
                          SessionFactoryImplementor factory)
                   throws MappingException
Overrides:
getJoinType in class OuterJoinLoader
Throws:
MappingException

getWhereFragment

protected String getWhereFragment()
                           throws MappingException
Use the discriminator, to narrow the select to instances of the queried subclass.

Overrides:
getWhereFragment in class AbstractEntityLoader
Throws:
MappingException

generateTableAlias

protected String generateTableAlias(String className,
                                    int n,
                                    String path,
                                    boolean isLinkTable)
Overrides:
generateTableAlias in class OuterJoinLoader

generateRootAlias

protected String generateRootAlias(String tableName)
Overrides:
generateRootAlias in class OuterJoinLoader

getQuerySpaces

public Set getQuerySpaces()

addToPropertySpaces

protected void addToPropertySpaces(Serializable space)
Overrides:
addToPropertySpaces in class AbstractEntityLoader

applyLocks

protected String applyLocks(String sqlSelectString,
                            Map lockModes,
                            Dialect dialect)
                     throws QueryException
Description copied from class: Loader
Append FOR UPDATE OF clause, if necessary. This empty superclass implementation merely returns its first argument.

Overrides:
applyLocks in class Loader
Throws:
QueryException

getLockModes

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

Overrides:
getLockModes in class OuterJoinLoader

getResultList

protected List getResultList(List results)
Overrides:
getResultList in class Loader