Top Description Inners Fields Constructors Methods
org.hibernate.impl

public Class SQLQueryImpl

extends AbstractQueryImpl
implements SQLQuery
Class Inheritance
All Implemented Interfaces
org.hibernate.SQLQuery, org.hibernate.Query
Imports
java.util.ArrayList, .Arrays, .Collection, .HashMap, .Iterator, .List, .Map, java.io.Serializable, org.hibernate.FlushMode, .HibernateException, .LockMode, .Query, .QueryException, .SQLQuery, .ScrollMode, .ScrollableResults, .MappingException, .LockOptions, org.hibernate.engine.query.sql.NativeSQLQuerySpecification, .NativeSQLQueryJoinReturn, .NativeSQLQueryScalarReturn, .NativeSQLQueryRootReturn, .NativeSQLQueryReturn, org.hibernate.engine.ResultSetMappingDefinition, .NamedSQLQueryDefinition, .QueryParameters, .SessionImplementor, org.hibernate.engine.query.ParameterMetadata, org.hibernate.type.Type, org.hibernate.util.StringHelper

Implementation of the SQLQuery contract.
Authors
Max Andersen, Steve Ebersole

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
private static interface
private class

Field Summary

Modifier and TypeField and Description
private boolean
private final boolean
private List<SQLQueryImpl.ReturnBuilder>
private List<NativeSQLQueryReturn>
private Collection<String>
Inherited from org.hibernate.impl.AbstractQueryImpl:
parameterMetadatasession

Constructor Summary

AccessConstructor and Description
pack-priv
SQLQueryImpl(NamedSQLQueryDefinition
The representation of the defined .
queryDef
,
SessionImplementor
The session to which this SQLQueryImpl belongs.
session
,
ParameterMetadata
Metadata about parameters found in the query.
parameterMetadata
)

Constructs a SQLQueryImpl given a sql query defined in the mappings.

pack-priv
SQLQueryImpl(final String sql, final String[] returnAliases, final Class<T>[] returnClasses, final LockMode[] lockModes, final SessionImplementor session, final Collection<String> querySpaces, final FlushMode flushMode, ParameterMetadata parameterMetadata)

pack-priv
SQLQueryImpl(final String sql, final String[] returnAliases, final Class<T>[] returnClasses, final SessionImplementor session, ParameterMetadata parameterMetadata)

pack-priv
SQLQueryImpl(String sql, SessionImplementor session, ParameterMetadata parameterMetadata)

Method Summary

Modifier and TypeMethod and Description
public SQLQuery
addEntity(String
The entity name that is the root return of the query.
entityName
)

Implements org.hibernate.SQLQuery.addEntity.

Declare a "root" entity, without specifying an alias.
public SQLQuery
addEntity(String
The SQL table alias
alias
,
String
The entity name
entityName
)

Implements org.hibernate.SQLQuery.addEntity.

Declare a "root" entity
public SQLQuery
addEntity(String
The SQL table alias
alias
,
String
The entity name
entityName
,
LockMode
The lock mode for this return.
lockMode
)

Implements org.hibernate.SQLQuery.addEntity.

Declare a "root" entity, specifying a lock mode
public SQLQuery
addEntity(Class<T>
The java type of the entity to add as a root
entityType
)

Implements org.hibernate.SQLQuery.addEntity.

Declare a "root" entity, without specifying an alias.
public SQLQuery
addEntity(String
The SQL table alias
alias
,
Class<T>
The java type of the entity to add as a root
entityClass
)

Implements org.hibernate.SQLQuery.addEntity.

Declare a "root" entity
public SQLQuery
addEntity(String
The SQL table alias
alias
,
Class<T>
The entity name
entityClass
,
LockMode
The lock mode for this return.
lockMode
)

Implements org.hibernate.SQLQuery.addEntity.

Declare a "root" entity, specifying a lock mode
public SQLQuery.FetchReturn
addFetch(String
The SQL table alias for the data to be mapped to this fetch
tableAlias
,
String
Identify the table alias of the owner of this association. Should match the alias of a previously added root or fetch
ownerTableAlias
,
String
The name of the property being join fetched.
joinPropertyName
)

Implements org.hibernate.SQLQuery.addFetch.

Declare a join fetch result.
public SQLQuery
addJoin(String
The SQL table alias for the data to be mapped to this fetch
tableAlias
,
String
Identify the table alias of the owner of this association. Should match the alias of a previously added root or fetch
ownerTableAlias
,
String
The name of the property being join fetched.
joinPropertyName
)

Implements org.hibernate.SQLQuery.addJoin.

Declare a join fetch result.
public SQLQuery
addJoin(String
The SQL table alias for the data to be mapped to this fetch
alias
,
String
The association path ([owner-alias].[property-name]).
path
)

Implements org.hibernate.SQLQuery.addJoin.

Declare a join fetch result.
public SQLQuery
addJoin(String
The SQL table alias for the data to be mapped to this fetch
alias
,
String
The association path ([owner-alias].[property-name]).
path
,
LockMode
The lock mode for this return.
lockMode
)

Implements org.hibernate.SQLQuery.addJoin.

Declare a join fetch result, specifying a lock mode
private SQLQuery
public SQLQuery.RootReturn
addRoot(String
The SQL table alias to map to this entity
tableAlias
,
String
The name of the entity.
entityName
)

Implements org.hibernate.SQLQuery.addRoot.

Add a new root return mapping, returning a RootReturn to allow further definition
public SQLQuery.RootReturn
addRoot(String
The SQL table alias to map to this entity
tableAlias
,
Class<T>
The java type of the entity.
entityType
)

Implements org.hibernate.SQLQuery.addRoot.

Add a new root return mapping, returning a RootReturn to allow further definition
public SQLQuery
addScalar(final String
The column alias in the result-set to be processed as a scalar result
columnAlias
,
final Type
The Hibernate type as which to treat the value.
type
)

Implements org.hibernate.SQLQuery.addScalar.

Declare a scalar query result.
public SQLQuery
addScalar(String
The column alias in the result-set to be processed as a scalar result
columnAlias
)

Implements org.hibernate.SQLQuery.addScalar.

Declare a scalar query result.
public SQLQuery
addSynchronizedEntityClass(Class<T>
The class of the entity upon whose defined query spaces we should additionally synchronize.
entityClass
)

Implements org.hibernate.SQLQuery.addSynchronizedEntityClass.

Adds an entity for (a) auto-flush checking and (b) query result cache invalidation checking.
public SQLQuery
addSynchronizedEntityName(String
The name of the entity upon whose defined query spaces we should additionally synchronize.
entityName
)

Implements org.hibernate.SQLQuery.addSynchronizedEntityName.

Adds an entity name for (a) auto-flush checking and (b) query result cache invalidation checking.
public SQLQuery
addSynchronizedQuerySpace(String
The query space to be auto-flushed for this query.
querySpace
)

Implements org.hibernate.SQLQuery.addSynchronizedQuerySpace.

Adds a query space (table name) for (a) auto-flush checking and (b) query result cache invalidation checking
private SQLQuery.FetchReturn
createFetchJoin(String tableAlias, String path)

public int
executeUpdate()

Implements org.hibernate.Query.executeUpdate.

Execute the update or delete statement.
private NativeSQLQuerySpecification
generateQuerySpecification(Map<K, V> namedParams)

public LockOptions
public QueryParameters
private NativeSQLQueryReturn[]
public String[]
getReturnAliases()

Overrides org.hibernate.impl.AbstractQueryImpl.getReturnAliases.

Implements org.hibernate.Query.getReturnAliases.

Return the HQL select clause aliases (if any)
public Type[]
getReturnTypes()

Overrides org.hibernate.impl.AbstractQueryImpl.getReturnTypes.

Implements org.hibernate.Query.getReturnTypes.

Return the Hibernate types of the query result set.
public Iterator<E>
iterate()

Implements org.hibernate.Query.iterate.

Return the query results as an Iterator.
public List<E>
list()

Implements org.hibernate.Query.list.

Return the query results as a List.
private void
public ScrollableResults
scroll(ScrollMode scrollMode)

Implements org.hibernate.Query.scroll.

Return the query results as ScrollableResults.
public ScrollableResults
scroll()

Implements org.hibernate.Query.scroll.

Return the query results as ScrollableResults.
public Query
setLockMode(String
a query alias, or this for a collection filter
alias
,
LockMode lockMode)

Implements org.hibernate.Query.setLockMode.

Set the lockmode for the objects idententified by the given alias that appears in the FROM clause.
public Query
setLockOptions(LockOptions lockOptions)

Implements org.hibernate.Query.setLockOptions.

Set the lock options for the objects idententified by the given alias that appears in the FROM clause.
public SQLQuery
setResultSetMapping(String
The name of the mapping to use.
name
)

Implements org.hibernate.SQLQuery.setResultSetMapping.

Use a predefined named result-set mapping.
protected void
Inherited from org.hibernate.impl.AbstractQueryImpl:
afterbeforedetermineTypedetermineTypedetermineTypedetermineTypedetermineTypeexpandParameterListsgetCacheModegetNamedParameterListsgetNamedParametersgetNamedParamsgetParameterMetadatagetQueryStringgetRowSelectiongetSelectiongetSessiongetTypesgetValueshasNamedParametersisReadOnlysetBigDecimalsetBigDecimalsetBigIntegersetBigIntegersetBinarysetBinarysetBooleansetBooleansetBytesetBytesetCacheablesetCacheModesetCacheRegionsetCalendarsetCalendarsetCalendarDatesetCalendarDatesetCharactersetCharactersetCollectionKeysetCommentsetDatesetDatesetDoublesetDoublesetEntitysetEntitysetFetchSizesetFirstResultsetFloatsetFloatsetFlushModesetIntegersetIntegersetLocalesetLocalesetLongsetLongsetMaxResultssetOptionalEntityNamesetOptionalIdsetOptionalObjectsetParametersetParametersetParametersetParametersetParameterListsetParameterListsetParameterListsetParameterListsetParameterssetPropertiessetPropertiessetReadOnlysetResultTransformersetSerializablesetSerializablesetShortsetShortsetStringsetStringsetTextsetTextsetTimesetTimesetTimeoutsetTimestampsetTimestamptoStringtypeArrayuniqueElementuniqueResultvalueArrayverifyParameters