org.hibernate.loader.criteria

Class CriteriaLoader


public class CriteriaLoader
extends OuterJoinLoader

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

Field Summary

Fields inherited from class org.hibernate.loader.OuterJoinLoader

aliases, collectionOwners, collectionPersisters, collectionSuffixes, lockModeArray, ownerAssociationTypes, owners, persisters, sql, suffixes

Fields inherited from class org.hibernate.loader.BasicLoader

NO_SUFFIX

Constructor Summary

CriteriaLoader(OuterJoinLoadable persister, SessionFactoryImplementor factory, CriteriaImpl criteria, String rootEntityName, Map enabledFilters)

Method Summary

protected String
applyLocks(String sqlSelectString, Map lockModes, Dialect dialect)
Append FOR UPDATE OF clause, if necessary.
protected LockMode[]
getLockModes(Map lockModes)
What lock mode does this load entities with?
Set
getQuerySpaces()
protected Object
getResultColumnOrRow(Object[] row, ResultTransformer transformer, ResultSet rs, SessionImplementor session)
Get the actual object that is returned in the user-visible result list.
protected List
getResultList(List results, ResultTransformer resultTransformer)
protected boolean
isSubselectLoadingEnabled()
List
list(SessionImplementor session)
ScrollableResults
scroll(SessionImplementor session, ScrollMode scrollMode)

Methods inherited from class org.hibernate.loader.OuterJoinLoader

getAliases, getCollectionOwners, getCollectionPersisters, getCollectionSuffixes, getDialect, getEnabledFilters, getEntityPersisters, getLockModes, getOwnerAssociationTypes, getOwners, getSQLString, getSuffixes, initFromWalker

Methods inherited from class org.hibernate.loader.BasicLoader

generateSuffixes, generateSuffixes, getCollectionAliases, getCollectionSuffixes, getEntityAliases, getSuffixes, postInstantiate

Methods inherited from class org.hibernate.loader.Loader

applyLocks, autoDiscoverTypes, bindNamedParameters, bindParameterValues, bindPositionalParameters, checkScrollability, doList, getAliases, getCollectionAliases, getCollectionOwners, getCollectionPersisters, getEntityAliases, getEntityEagerPropertyFetches, getEntityPersisters, getFactory, getLockModes, getNamedParameterLocs, getOwnerAssociationTypes, getOwners, getQueryIdentifier, getResultColumnOrRow, getResultList, getResultSet, getSQLString, hasSubselectLoadableCollections, isSingleRowLoader, isSubselectLoadingEnabled, list, loadCollection, loadCollectionBatch, loadCollectionSubselect, loadEntity, loadEntity, loadEntityBatch, loadSequentialRowsForward, loadSequentialRowsReverse, loadSingleRow, needsFetchingScroll, postInstantiate, prepareQueryStatement, preprocessSQL, scroll, toString, upgradeLocks

Constructor Details

CriteriaLoader

public CriteriaLoader(OuterJoinLoadable persister,
                      SessionFactoryImplementor factory,
                      CriteriaImpl criteria,
                      String rootEntityName,
                      Map enabledFilters)
            throws HibernateException

Method Details

applyLocks

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

getLockModes

protected LockMode[] getLockModes(Map lockModes)
What lock mode does this load entities with?
Overrides:
getLockModes in interface OuterJoinLoader
Parameters:
lockModes - a collection of lock modes specified dynamically via the Query interface

getQuerySpaces

public Set getQuerySpaces()

getResultColumnOrRow

protected Object getResultColumnOrRow(Object[] row,
                                      ResultTransformer transformer,
                                      ResultSet rs,
                                      SessionImplementor session)
            throws SQLException,
                   HibernateException
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 interface Loader

getResultList

protected List getResultList(List results,
                             ResultTransformer resultTransformer)
Overrides:
getResultList in interface Loader

isSubselectLoadingEnabled

protected boolean isSubselectLoadingEnabled()
Overrides:
isSubselectLoadingEnabled in interface Loader

list

public List list(SessionImplementor session)
            throws HibernateException

scroll

public ScrollableResults scroll(SessionImplementor session,
                                ScrollMode scrollMode)
            throws HibernateException