public class SQLQueryImpl extends AbstractQueryImpl implements SQLQuery
SQLQuery
contract.SQLQuery.FetchReturn, SQLQuery.ReturnProperty, SQLQuery.RootReturn
parameterMetadata, 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 (table name) for (a) auto-flush checking and (b) query result cache invalidation checking
|
int |
executeUpdate()
Execute the update or delete statement.
|
LockOptions |
getLockOptions() |
QueryParameters |
getQueryParameters(Map namedParams) |
String[] |
getReturnAliases()
Return the HQL select clause aliases (if any)
|
Type[] |
getReturnTypes()
Return the Hibernate types of the query result set.
|
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 for the objects idententified by the
given alias that appears in the FROM clause.
|
Query |
setLockOptions(LockOptions lockOptions)
Set the lock options for the objects idententified by the
given alias that appears in the FROM clause.
|
SQLQuery |
setResultSetMapping(String name)
Use a predefined named result-set mapping.
|
protected void |
verifyParameters()
Perform parameter validation.
|
after, before, determineType, determineType, determineType, determineType, determineType, expandParameterLists, getCacheMode, getNamedParameterLists, getNamedParameters, getNamedParams, getParameterMetadata, getQueryString, getRowSelection, getSelection, getTypes, getValues, hasNamedParameters, 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, verifyParameters
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getNamedParameters, getQueryString, isReadOnly, 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, uniqueResult
public List list() throws HibernateException
Query
list
in interface Query
HibernateException
public ScrollableResults scroll(ScrollMode scrollMode) throws HibernateException
Query
scroll
in interface Query
HibernateException
ScrollableResults
,
ScrollMode
public ScrollableResults scroll() throws HibernateException
Query
scroll
in interface Query
HibernateException
ScrollableResults
public Iterator iterate() throws HibernateException
Query
iterate
in interface Query
HibernateException
public QueryParameters getQueryParameters(Map namedParams)
getQueryParameters
in class AbstractQueryImpl
protected void verifyParameters()
AbstractQueryImpl
verifyParameters
in class AbstractQueryImpl
public String[] getReturnAliases() throws HibernateException
Query
getReturnAliases
in interface Query
getReturnAliases
in class AbstractQueryImpl
HibernateException
public Type[] getReturnTypes() throws HibernateException
Query
getReturnTypes
in interface Query
getReturnTypes
in class AbstractQueryImpl
HibernateException
public Query setLockMode(String alias, LockMode lockMode)
Query
setLockMode
in interface Query
alias
- a query alias, or this for a collection filterpublic Query setLockOptions(LockOptions lockOptions)
Query
setLockOptions
in interface Query
public LockOptions getLockOptions()
getLockOptions
in class AbstractQueryImpl
public SQLQuery addScalar(String columnAlias, Type type)
SQLQuery
public SQLQuery addScalar(String columnAlias)
SQLQuery
<return-scalar/>
in hbm.xml
or ColumnResult
public SQLQuery.RootReturn addRoot(String tableAlias, String entityName)
SQLQuery
SQLQuery.RootReturn
to allow further definitionpublic SQLQuery.RootReturn addRoot(String tableAlias, Class entityType)
SQLQuery
SQLQuery.RootReturn
to allow further definitionpublic SQLQuery addEntity(String entityName)
SQLQuery
SQLQuery.addRoot(java.lang.String, java.lang.String)
if you need further control of the mappingpublic SQLQuery addEntity(String alias, String entityName)
SQLQuery
public SQLQuery addEntity(String alias, String entityName, LockMode lockMode)
SQLQuery
public SQLQuery addEntity(Class entityType)
SQLQuery
public SQLQuery addEntity(String alias, Class entityClass)
SQLQuery
public SQLQuery addEntity(String alias, Class entityClass, LockMode lockMode)
SQLQuery
public SQLQuery.FetchReturn addFetch(String tableAlias, String ownerTableAlias, String joinPropertyName)
SQLQuery
addFetch
in interface SQLQuery
tableAlias
- 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)
SQLQuery
addJoin
in interface SQLQuery
tableAlias
- 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)
SQLQuery
public SQLQuery addJoin(String alias, String path, LockMode lockMode)
SQLQuery
public SQLQuery setResultSetMapping(String name)
SQLQuery
<result-set/>
element in a
Hibernate hbm.xml file or through a SqlResultSetMapping
annotation.setResultSetMapping
in interface SQLQuery
name
- The name of the mapping to use.public SQLQuery addSynchronizedQuerySpace(String querySpace)
SQLQuery
addSynchronizedQuerySpace
in interface SQLQuery
querySpace
- The query space to be auto-flushed for this query.public SQLQuery addSynchronizedEntityName(String entityName)
SQLQuery
SQLQuery.addSynchronizedQuerySpace(java.lang.String)
for all tables associated with the given entity.addSynchronizedEntityName
in interface SQLQuery
entityName
- The name of the entity upon whose defined query spaces we should additionally synchronize.public SQLQuery addSynchronizedEntityClass(Class entityClass)
SQLQuery
SQLQuery.addSynchronizedQuerySpace(java.lang.String)
for all tables associated with the given entity.addSynchronizedEntityClass
in interface SQLQuery
entityClass
- The class of the entity upon whose defined query spaces we should additionally synchronize.public int executeUpdate() throws HibernateException
Query
executeUpdate
in interface Query
HibernateException
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.