public class SQLQueryImpl extends AbstractQueryImpl implements SQLQuery
SQLQuery contract.SQLQuery.FetchReturn, SQLQuery.ReturnProperty, SQLQuery.RootReturnparameterMetadata, session| Modifier and Type | Method and Description |
|---|---|
SQLQuery |
addEntity(Class entityType)
Declare a "root" entity, without specifying an alias.
|
SQLQuery |
addEntity(String entityName)
Declare a "root" entity, without specifying an alias.
|
SQLQuery |
addEntity(String alias,
Class entityClass)
Declare a "root" entity.
|
SQLQuery |
addEntity(String alias,
Class entityClass,
LockMode lockMode)
Declare a "root" entity, specifying a lock mode.
|
SQLQuery |
addEntity(String alias,
String entityName)
Declare a "root" entity.
|
SQLQuery |
addEntity(String alias,
String entityName,
LockMode lockMode)
Declare a "root" entity, specifying a lock mode.
|
SQLQuery.FetchReturn |
addFetch(String tableAlias,
String ownerTableAlias,
String joinPropertyName)
Declare a join fetch result.
|
SQLQuery |
addJoin(String alias,
String path)
Declare a join fetch result.
|
SQLQuery |
addJoin(String alias,
String path,
LockMode lockMode)
Declare a join fetch result, specifying a lock mode.
|
SQLQuery |
addJoin(String tableAlias,
String ownerTableAlias,
String joinPropertyName)
Declare a join fetch result.
|
SQLQuery.RootReturn |
addRoot(String tableAlias,
Class entityType)
Add a new root return mapping, returning a
SQLQuery.RootReturn to allow further definition. |
SQLQuery.RootReturn |
addRoot(String tableAlias,
String entityName)
Add a new root return mapping, returning a
SQLQuery.RootReturn to allow further definition. |
SQLQuery |
addScalar(String columnAlias)
Declare a scalar query result.
|
SQLQuery |
addScalar(String columnAlias,
Type type)
Declare a scalar query result.
|
SQLQuery |
addSynchronizedEntityClass(Class entityClass)
Adds an entity for (a) auto-flush checking and (b) query result cache invalidation checking.
|
SQLQuery |
addSynchronizedEntityName(String entityName)
Adds an entity name for (a) auto-flush checking and (b) query result cache invalidation checking.
|
SQLQuery |
addSynchronizedQuerySpace(String querySpace)
Adds a query space.
|
int |
executeUpdate()
Execute the update or delete statement.
|
LockOptions |
getLockOptions()
Obtains the LockOptions in effect for this query.
|
QueryParameters |
getQueryParameters(Map namedParams) |
List<NativeSQLQueryReturn> |
getQueryReturns()
Retrieve the returns associated with this query.
|
String[] |
getReturnAliases()
Return the HQL select clause aliases, if any.
|
Type[] |
getReturnTypes()
Return the Hibernate types of the query results.
|
Collection<String> |
getSynchronizedQuerySpaces()
Obtain the list of query spaces the query is synchronized on.
|
boolean |
isCallable()
Is this native-SQL query known to be callable?
|
Iterator |
iterate()
Return the query results as an Iterator.
|
List |
list()
Return the query results as a List.
|
ScrollableResults |
scroll()
Return the query results as ScrollableResults.
|
ScrollableResults |
scroll(ScrollMode scrollMode)
Return the query results as ScrollableResults.
|
Query |
setLockMode(String alias,
LockMode lockMode)
Set the LockMode to use for specific alias (as defined in the query's FROM clause).
|
Query |
setLockOptions(LockOptions lockOptions)
Set the lock options for the query.
|
SQLQuery |
setResultSetMapping(String name)
Use a predefined named result-set mapping.
|
protected void |
verifyParameters()
Perform parameter validation.
|
addQueryHint, after, applyEntityGraphQueryHint, before, determineType, determineType, determineType, determineType, determineType, expandParameterLists, getCacheMode, getCacheRegion, getComment, getFetchSize, getFirstResult, getFlushMode, getMaxResults, getNamedParameterLists, getNamedParameters, getNamedParams, getParameterMetadata, getQueryString, getRowSelection, getTimeout, getTypes, getValues, guessType, hasNamedParameters, isCacheable, isReadOnly, setBigDecimal, setBigDecimal, setBigInteger, setBigInteger, setBinary, setBinary, setBoolean, setBoolean, setByte, setByte, setCacheable, setCacheMode, setCacheRegion, setCalendar, setCalendar, setCalendarDate, setCalendarDate, setCharacter, setCharacter, setCollectionKey, setComment, setDate, setDate, setDouble, setDouble, setEntity, setEntity, setFetchSize, setFirstResult, setFloat, setFloat, setFlushMode, setInteger, setInteger, setLocale, setLocale, setLong, setLong, setMaxResults, setOptionalEntityName, setOptionalId, setOptionalObject, setParameter, setParameter, setParameter, setParameter, setParameterList, setParameterList, setParameterList, setParameterList, setParameters, setProperties, setProperties, setReadOnly, setResultTransformer, setSerializable, setSerializable, setShort, setShort, setString, setString, setText, setText, setTime, setTime, setTimeout, setTimestamp, setTimestamp, toString, typeArray, uniqueResult, valueArray, verifyParametersclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddQueryHint, getComment, getFirstResult, getMaxResults, getNamedParameters, getQueryString, setBigDecimal, setBigDecimal, setBigInteger, setBigInteger, setBinary, setBinary, setBoolean, setBoolean, setByte, setByte, setCacheable, setCacheMode, setCacheRegion, setCalendar, setCalendar, setCalendarDate, setCalendarDate, setCharacter, setCharacter, setComment, setDate, setDate, setDouble, setDouble, setEntity, setEntity, setFetchSize, setFirstResult, setFloat, setFloat, setFlushMode, setInteger, setInteger, setLocale, setLocale, setLong, setLong, setMaxResults, setParameter, setParameter, setParameter, setParameter, setParameterList, setParameterList, setParameterList, setParameterList, setParameters, setProperties, setProperties, setReadOnly, setResultTransformer, setSerializable, setSerializable, setShort, setShort, setString, setString, setText, setText, setTime, setTime, setTimeout, setTimestamp, setTimestamp, uniqueResultgetCacheMode, getCacheRegion, getFetchSize, getFlushMode, getTimeout, isCacheable, isReadOnlypublic List<NativeSQLQueryReturn> getQueryReturns()
SQLQuerygetQueryReturns in interface SQLQuerypublic Collection<String> getSynchronizedQuerySpaces()
SynchronizeableQuerygetSynchronizedQuerySpaces in interface SynchronizeableQuerypublic boolean isCallable()
SQLQueryisCallable in interface SQLQuerytrue if the query is known to be callable; false otherwise.public List list() throws HibernateException
Querylist in interface QueryHibernateExceptionpublic ScrollableResults scroll(ScrollMode scrollMode) throws HibernateException
Queryscroll in interface QueryscrollMode - The scroll modeHibernateExceptionScrollableResults,
ScrollModepublic ScrollableResults scroll() throws HibernateException
Queryscroll in interface QueryHibernateExceptionScrollableResultspublic Iterator iterate() throws HibernateException
Queryiterate in interface QueryHibernateExceptionpublic QueryParameters getQueryParameters(Map namedParams)
getQueryParameters in class AbstractQueryImplprotected void verifyParameters()
AbstractQueryImplverifyParameters in class AbstractQueryImplpublic String[] getReturnAliases() throws HibernateException
QuerygetReturnAliases in interface QuerygetReturnAliases in class AbstractQueryImplHibernateExceptionpublic Type[] getReturnTypes() throws HibernateException
BasicQueryContractgetReturnTypes in interface BasicQueryContractgetReturnTypes in class AbstractQueryImplHibernateExceptionpublic Query setLockMode(String alias, LockMode lockMode)
QueryLockOptions.
The effect of these alias-specific LockModes is somewhat dependent on the driver/database in use. Generally
speaking, for maximum portability, this method should only be used to mark that the rows corresponding to
the given alias should be included in pessimistic locking (LockMode.PESSIMISTIC_WRITE).setLockMode in interface Queryalias - a query alias, or "this" for a collection filterlockMode - The lock mode to apply.this, for method chainingQuery.getLockOptions()public Query setLockOptions(LockOptions lockOptions)
QueryQuery.setLockMode(String, LockMode).setLockOptions in interface QuerylockOptions - The lock options to apply to the query.this, for method chainingQuery.getLockOptions()public LockOptions getLockOptions()
QuerygetLockOptions in interface QuerygetLockOptions in class AbstractQueryImplLockOptionspublic SQLQuery addScalar(String columnAlias, Type type)
SQLQuerypublic SQLQuery addScalar(String columnAlias)
SQLQuery<return-scalar/> in hbm.xml or ColumnResultpublic SQLQuery.RootReturn addRoot(String tableAlias, String entityName)
SQLQuerySQLQuery.RootReturn to allow further definition.public SQLQuery.RootReturn addRoot(String tableAlias, Class entityType)
SQLQuerySQLQuery.RootReturn to allow further definition.public SQLQuery addEntity(String entityName)
SQLQuerySQLQuery.addRoot(java.lang.String, java.lang.String) if you need further control of the mappingpublic SQLQuery addEntity(String alias, String entityName)
SQLQuerypublic SQLQuery addEntity(String alias, String entityName, LockMode lockMode)
SQLQuerypublic SQLQuery addEntity(Class entityType)
SQLQuerypublic SQLQuery addEntity(String alias, Class entityClass)
SQLQuerypublic SQLQuery addEntity(String alias, Class entityClass, LockMode lockMode)
SQLQuerypublic SQLQuery.FetchReturn addFetch(String tableAlias, String ownerTableAlias, String joinPropertyName)
SQLQueryaddFetch in interface SQLQuerytableAlias - The SQL table alias for the data to be mapped to this fetchownerTableAlias - Identify the table alias of the owner of this association. Should match the alias of a
previously added root or fetchjoinPropertyName - The name of the property being join fetched.public SQLQuery addJoin(String tableAlias, String ownerTableAlias, String joinPropertyName)
SQLQueryaddJoin in interface SQLQuerytableAlias - The SQL table alias for the data to be mapped to this fetchownerTableAlias - Identify the table alias of the owner of this association. Should match the alias of a
previously added root or fetchjoinPropertyName - The name of the property being join fetched.this, for method chainingpublic SQLQuery addJoin(String alias, String path)
SQLQuerypublic SQLQuery addJoin(String alias, String path, LockMode lockMode)
SQLQuerypublic SQLQuery setResultSetMapping(String name)
SQLQuery<result-set/> element in a
Hibernate hbm.xml file or through a SqlResultSetMapping annotation.setResultSetMapping in interface SQLQueryname - The name of the mapping to use.public SQLQuery addSynchronizedQuerySpace(String querySpace)
SynchronizeableQueryaddSynchronizedQuerySpace in interface SQLQueryaddSynchronizedQuerySpace in interface SynchronizeableQueryquerySpace - The query space to be auto-flushed for this query.this, for method chainingpublic SQLQuery addSynchronizedEntityName(String entityName)
SynchronizeableQuerySynchronizeableQuery.addSynchronizedQuerySpace(java.lang.String) for all tables associated with the given entity.addSynchronizedEntityName in interface SQLQueryaddSynchronizedEntityName in interface SynchronizeableQueryentityName - The name of the entity upon whose defined query spaces we should additionally synchronize.this, for method chainingpublic SQLQuery addSynchronizedEntityClass(Class entityClass)
SynchronizeableQuerySynchronizeableQuery.addSynchronizedQuerySpace(java.lang.String) for all tables associated with the given entity.addSynchronizedEntityClass in interface SQLQueryaddSynchronizedEntityClass in interface SynchronizeableQueryentityClass - The class of the entity upon whose defined query spaces we should additionally synchronize.this, for method chainingpublic int executeUpdate()
throws HibernateException
QueryexecuteUpdate in interface QueryHibernateExceptionCopyright © 2017 JBoss by Red Hat. All rights reserved.