Package org.hibernate.loader.criteria
Class CriteriaLoader
- java.lang.Object
-
- org.hibernate.loader.Loader
-
- org.hibernate.loader.BasicLoader
-
- org.hibernate.loader.OuterJoinLoader
-
- org.hibernate.loader.criteria.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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.hibernate.loader.Loader
Loader.SqlStatementWrapper
-
-
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
-
Fields inherited from class org.hibernate.loader.Loader
LOG, SELECT, SELECT_DISTINCT
-
-
Constructor Summary
Constructors Constructor Description CriteriaLoader(OuterJoinLoadable persister, SessionFactoryImplementor factory, org.hibernate.internal.CriteriaImpl criteria, java.lang.String rootEntityName, LoadQueryInfluencers loadQueryInfluencers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringapplyLocks(java.lang.String sql, QueryParameters parameters, Dialect dialect, java.util.List<AfterLoadAction> afterLoadActions)Append FOR UPDATE OF clause, if necessary.protected booleanareResultSetRowsTransformedImmediately()Are rows transformed immediately after being read from the ResultSet?protected LockModedetermineFollowOnLockMode(LockOptions lockOptions)protected LockMode[]getLockModes(LockOptions lockOptions)What lock options does this load entities with?protected java.lang.StringgetQueryIdentifier()Identifies the query for statistics reporting, if null, no statistics will be reportedjava.util.SetgetQuerySpaces()protected java.lang.ObjectgetResultColumnOrRow(java.lang.Object[] row, ResultTransformer transformer, java.sql.ResultSet rs, SharedSessionContractImplementor session)Get the actual object that is returned in the user-visible result list.protected java.util.ListgetResultList(java.util.List results, ResultTransformer resultTransformer)protected java.lang.Object[]getResultRow(java.lang.Object[] row, java.sql.ResultSet rs, SharedSessionContractImplementor session)protected java.lang.String[]getResultRowAliases()Returns the aliases that corresponding to a result row.protected boolean[]includeInResultRow()protected booleanisSubselectLoadingEnabled()java.util.Listlist(SharedSessionContractImplementor session)protected ResultTransformerresolveResultTransformer(ResultTransformer resultTransformer)Determine the actual ResultTransformer that will be used to transform query results.ScrollableResultsImplementorscroll(SharedSessionContractImplementor session, ScrollMode scrollMode)-
Methods inherited from class org.hibernate.loader.OuterJoinLoader
getAliases, getCollectionOwners, getCollectionPersisters, getCollectionSuffixes, getDialect, getEntityPersisters, getLoadQueryInfluencers, getLockOptions, getOwnerAssociationTypes, getOwners, getSQLString, getSuffixes, initFromWalker
-
Methods inherited from class org.hibernate.loader.BasicLoader
generateSuffixes, generateSuffixes, getCollectionAliases, getEntityAliases, postInstantiate
-
Methods inherited from class org.hibernate.loader.Loader
applyPostLoadLocks, autoDiscoverTypes, bindNamedParameters, bindParameterValues, bindPositionalParameters, bindPreparedStatement, checkScrollability, createCacheableResultTransformer, createSubselects, doList, doQueryAndInitializeNonLazyCollections, doQueryAndInitializeNonLazyCollections, endCollectionLoad, executeQueryStatement, executeQueryStatement, extractKeysFromResultSet, generateQueryKey, getCompositeKeyManyToOneTargetIndices, getEntityEagerPerPropertyFetches, getEntityEagerPropertyFetches, getEntityPersister, getFactory, getLimitHandler, getNamedParameterLocs, getOptionalObjectKey, getResultFromQueryCache, getResultSet, getResultSet, getRowsFromResultSet, handleEmptyCollections, hasSubselectLoadableCollections, instanceAlreadyLoaded, instanceNotYetLoaded, isSingleRowLoader, list, loadCollection, loadCollectionBatch, loadCollectionSubselect, loadEntity, loadEntity, loadEntityBatch, loadEntityBatch, loadSequentialRowsForward, loadSequentialRowsReverse, loadSingleRow, needsFetchingScroll, prepareQueryStatement, preprocessResultSet, preprocessSQL, processDistinctKeyword, processResultSet, putResultInQueryCache, registerNonExists, scroll, shouldUseFollowOnLocking, toString, upgradeLocks
-
-
-
-
Constructor Detail
-
CriteriaLoader
public CriteriaLoader(OuterJoinLoadable persister, SessionFactoryImplementor factory, org.hibernate.internal.CriteriaImpl criteria, java.lang.String rootEntityName, LoadQueryInfluencers loadQueryInfluencers) throws HibernateException
- Throws:
HibernateException
-
-
Method Detail
-
scroll
public ScrollableResultsImplementor scroll(SharedSessionContractImplementor session, ScrollMode scrollMode) throws HibernateException
- Throws:
HibernateException
-
list
public java.util.List list(SharedSessionContractImplementor session) throws HibernateException
- Throws:
HibernateException
-
getResultRowAliases
protected java.lang.String[] getResultRowAliases()
Description copied from class:LoaderReturns the aliases that corresponding to a result row.- Overrides:
getResultRowAliasesin classLoader- Returns:
- Returns the aliases that corresponding to a result row.
-
resolveResultTransformer
protected ResultTransformer resolveResultTransformer(ResultTransformer resultTransformer)
Description copied from class:LoaderDetermine the actual ResultTransformer that will be used to transform query results.- Overrides:
resolveResultTransformerin classLoader- Parameters:
resultTransformer- the specified result transformer- Returns:
- the actual result transformer
-
areResultSetRowsTransformedImmediately
protected boolean areResultSetRowsTransformedImmediately()
Description copied from class:LoaderAre rows transformed immediately after being read from the ResultSet?- Overrides:
areResultSetRowsTransformedImmediatelyin classLoader- Returns:
- true, if getResultColumnOrRow() transforms the results; false, otherwise
-
includeInResultRow
protected boolean[] includeInResultRow()
- Overrides:
includeInResultRowin classLoader
-
getResultColumnOrRow
protected java.lang.Object getResultColumnOrRow(java.lang.Object[] row, ResultTransformer transformer, java.sql.ResultSet rs, SharedSessionContractImplementor session) throws java.sql.SQLException, HibernateExceptionDescription copied from class:LoaderGet 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:
getResultColumnOrRowin classLoader- Throws:
java.sql.SQLExceptionHibernateException
-
getResultRow
protected java.lang.Object[] getResultRow(java.lang.Object[] row, java.sql.ResultSet rs, SharedSessionContractImplementor session) throws java.sql.SQLException, HibernateException- Overrides:
getResultRowin classLoader- Throws:
java.sql.SQLExceptionHibernateException
-
getQuerySpaces
public java.util.Set getQuerySpaces()
-
applyLocks
protected java.lang.String applyLocks(java.lang.String sql, QueryParameters parameters, Dialect dialect, java.util.List<AfterLoadAction> afterLoadActions) throws QueryExceptionDescription copied from class:LoaderAppend FOR UPDATE OF clause, if necessary. This empty superclass implementation merely returns its first argument.- Overrides:
applyLocksin classLoader- Throws:
QueryException
-
determineFollowOnLockMode
protected LockMode determineFollowOnLockMode(LockOptions lockOptions)
- Overrides:
determineFollowOnLockModein classLoader
-
getLockModes
protected LockMode[] getLockModes(LockOptions lockOptions)
Description copied from class:LoaderWhat lock options does this load entities with?- Overrides:
getLockModesin classOuterJoinLoader- Parameters:
lockOptions- a collection of lock options specified dynamically via the Query interface
-
isSubselectLoadingEnabled
protected boolean isSubselectLoadingEnabled()
- Overrides:
isSubselectLoadingEnabledin classLoader
-
getResultList
protected java.util.List getResultList(java.util.List results, ResultTransformer resultTransformer)- Overrides:
getResultListin classLoader
-
getQueryIdentifier
protected java.lang.String getQueryIdentifier()
Description copied from class:LoaderIdentifies the query for statistics reporting, if null, no statistics will be reported- Overrides:
getQueryIdentifierin classLoader
-
-