public class QueryLoader extends BasicLoader
Loader.SqlStatementWrapperNO_SUFFIXDEBUG_ENABLED, LOG| Constructor and Description |
|---|
QueryLoader(QueryTranslatorImpl queryTranslator,
SessionFactoryImplementor factory,
SelectClause selectClause)
Creates a new Loader implementation.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.String |
applyLocks(java.lang.String sql,
QueryParameters parameters,
Dialect dialect,
java.util.List<AfterLoadAction> afterLoadActions)
Append FOR UPDATE OF clause, if necessary.
|
protected void |
applyPostLoadLocks(java.lang.Object[] row,
LockMode[] lockModesArray,
SessionImplementor session) |
protected int |
bindParameterValues(java.sql.PreparedStatement statement,
QueryParameters queryParameters,
int startIndex,
SessionImplementor session)
We specifically override this method here, because in general we know much more
about the parameters and their appropriate bind positions here then we do in
our super because we track them explicitly here through the ParameterSpecification
interface.
|
AggregatedSelectExpression |
getAggregatedSelectExpression() |
java.lang.String[] |
getAliases()
Get the SQL table aliases of entities whose
associations are subselect-loadable, returning
null if this loader does not support subselect
loading
|
protected int[] |
getCollectionOwners()
Get the index of the entity that owns the collection, or -1
if there is no owner in the query results (ie.
|
protected CollectionPersister[] |
getCollectionPersisters()
An (optional) persister for a collection to be initialized; only collection loaders
return a non-null value
|
java.lang.String[] |
getCollectionSuffixes() |
protected boolean[] |
getEntityEagerPropertyFetches()
An array indicating whether the entities have eager property fetching
enabled.
|
Loadable[] |
getEntityPersisters()
An array of persisters of entity classes contained in each row of results;
implemented by all subclasses
|
protected LockMode[] |
getLockModes(LockOptions lockOptions)
What lock options does this load entities with?
|
int[] |
getNamedParameterLocs(java.lang.String name)
Returns the locations of all occurrences of the named parameter.
|
protected EntityType[] |
getOwnerAssociationTypes()
An array of the owner types corresponding to the
Loader.getOwners()
returns. |
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 java.lang.String |
getQueryIdentifier()
Identifies the query for statistics reporting, if null,
no statistics will be reported
|
protected java.lang.Object |
getResultColumnOrRow(java.lang.Object[] row,
ResultTransformer transformer,
java.sql.ResultSet rs,
SessionImplementor session)
Get the actual object that is returned in the user-visible result list.
|
protected java.util.List |
getResultList(java.util.List results,
ResultTransformer resultTransformer) |
protected java.lang.Object[] |
getResultRow(java.lang.Object[] row,
java.sql.ResultSet rs,
SessionImplementor session) |
protected java.lang.String[] |
getResultRowAliases()
Returns the aliases that corresponding to a result row.
|
java.lang.String[] |
getSqlAliasSuffixes() |
java.lang.String |
getSQLString()
The SQL query string to be called.
|
java.lang.String[] |
getSuffixes() |
protected boolean[] |
includeInResultRow() |
protected boolean |
isSubselectLoadingEnabled() |
java.util.Iterator |
iterate(QueryParameters queryParameters,
EventSource session) |
java.util.List |
list(SessionImplementor session,
QueryParameters queryParameters) |
protected boolean |
needsFetchingScroll()
Does the result set to be scrolled contain collection fetches?
|
protected ResultTransformer |
resolveResultTransformer(ResultTransformer resultTransformer)
Determine the actual ResultTransformer that will be used to
transform query results.
|
ScrollableResults |
scroll(QueryParameters queryParameters,
SessionImplementor session) |
protected boolean |
upgradeLocks()
Does this query return objects that might be already cached
by the session, whose lock mode may need upgrading
|
void |
validateScrollability() |
generateSuffixes, generateSuffixes, getCollectionAliases, getEntityAliases, postInstantiateareResultSetRowsTransformedImmediately, autoDiscoverTypes, bindNamedParameters, bindPositionalParameters, checkScrollability, determineFollowOnLockMode, doList, doQueryAndInitializeNonLazyCollections, doQueryAndInitializeNonLazyCollections, executeQueryStatement, executeQueryStatement, extractKeysFromResultSet, getCompositeKeyManyToOneTargetIndices, getFactory, getLimitHandler, getResultSet, hasSubselectLoadableCollections, isSingleRowLoader, list, loadCollection, loadCollectionBatch, loadCollectionSubselect, loadEntity, loadEntity, loadEntityBatch, loadSequentialRowsForward, loadSequentialRowsReverse, loadSingleRow, prepareQueryStatement, preprocessSQL, processResultSet, putResultInQueryCache, scroll, shouldUseFollowOnLocking, toStringpublic QueryLoader(QueryTranslatorImpl queryTranslator, SessionFactoryImplementor factory, SelectClause selectClause)
queryTranslator - The query translator that is the delegator.factory - The factory from which this loader is being created.selectClause - The AST representing the select clause for loading.public AggregatedSelectExpression getAggregatedSelectExpression()
public final void validateScrollability()
throws HibernateException
HibernateExceptionprotected boolean needsFetchingScroll()
LoaderneedsFetchingScroll in class Loaderpublic Loadable[] getEntityPersisters()
LoadergetEntityPersisters in class Loaderpublic java.lang.String[] getAliases()
LoadergetAliases in class Loaderpublic java.lang.String[] getSqlAliasSuffixes()
public java.lang.String[] getSuffixes()
getSuffixes in class BasicLoaderpublic java.lang.String[] getCollectionSuffixes()
getCollectionSuffixes in class BasicLoaderprotected java.lang.String getQueryIdentifier()
LoadergetQueryIdentifier in class Loaderpublic java.lang.String getSQLString()
getSQLString in class LoaderResultSet.protected CollectionPersister[] getCollectionPersisters()
getCollectionPersisters in class Loaderprotected int[] getCollectionOwners()
LoadergetCollectionOwners in class Loaderprotected boolean[] getEntityEagerPropertyFetches()
LoadergetEntityEagerPropertyFetches in class Loaderprotected int[] getOwners()
protected EntityType[] getOwnerAssociationTypes()
LoaderLoader.getOwners()
returns. Indices indicating no owner would be null here.getOwnerAssociationTypes in class Loaderprotected boolean isSubselectLoadingEnabled()
isSubselectLoadingEnabled in class Loaderprotected LockMode[] getLockModes(LockOptions lockOptions)
LoadergetLockModes in class LoaderlockOptions - a collection of lock modes specified dynamically via the Query interfaceprotected java.lang.String applyLocks(java.lang.String sql,
QueryParameters parameters,
Dialect dialect,
java.util.List<AfterLoadAction> afterLoadActions)
throws QueryException
LoaderapplyLocks in class LoaderQueryExceptionprotected void applyPostLoadLocks(java.lang.Object[] row,
LockMode[] lockModesArray,
SessionImplementor session)
applyPostLoadLocks in class Loaderprotected boolean upgradeLocks()
LoaderupgradeLocks in class Loaderprotected java.lang.String[] getResultRowAliases()
LoadergetResultRowAliases in class Loaderprotected ResultTransformer resolveResultTransformer(ResultTransformer resultTransformer)
LoaderresolveResultTransformer in class LoaderresultTransformer - the specified result transformerprotected boolean[] includeInResultRow()
includeInResultRow in class Loaderprotected java.lang.Object getResultColumnOrRow(java.lang.Object[] row,
ResultTransformer transformer,
java.sql.ResultSet rs,
SessionImplementor session)
throws java.sql.SQLException,
HibernateException
LoadergetResultColumnOrRow in class Loaderjava.sql.SQLExceptionHibernateExceptionprotected java.lang.Object[] getResultRow(java.lang.Object[] row,
java.sql.ResultSet rs,
SessionImplementor session)
throws java.sql.SQLException,
HibernateException
getResultRow in class Loaderjava.sql.SQLExceptionHibernateExceptionprotected java.util.List getResultList(java.util.List results,
ResultTransformer resultTransformer)
throws QueryException
getResultList in class LoaderQueryExceptionpublic java.util.List list(SessionImplementor session, QueryParameters queryParameters) throws HibernateException
HibernateExceptionpublic java.util.Iterator iterate(QueryParameters queryParameters, EventSource session) throws HibernateException
HibernateExceptionpublic ScrollableResults scroll(QueryParameters queryParameters, SessionImplementor session) throws HibernateException
HibernateExceptionpublic int[] getNamedParameterLocs(java.lang.String name)
throws QueryException
getNamedParameterLocs in class LoaderQueryExceptionprotected int bindParameterValues(java.sql.PreparedStatement statement,
QueryParameters queryParameters,
int startIndex,
SessionImplementor session)
throws java.sql.SQLException
bindParameterValues in class LoaderqueryParameters - The encapsulation of the parameter values to be bound.startIndex - The position from which to start binding parameter values.session - The originating session.statement - The JDBC prepared statementjava.sql.SQLException - Indicates problems performing the binding.Copyright © 2001-2018 Red Hat, Inc. All Rights Reserved.