|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.hibernate.impl.AbstractQueryImpl org.hibernate.impl.SQLQueryImpl
public class SQLQueryImpl
Implementation of the SQLQuery
contract.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.hibernate.SQLQuery |
---|
SQLQuery.FetchReturn, SQLQuery.ReturnProperty, SQLQuery.RootReturn |
Field Summary |
---|
Fields inherited from class org.hibernate.impl.AbstractQueryImpl |
---|
parameterMetadata, session |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
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
<return-scalar/>
in hbm.xml
or ColumnResult
addScalar
in interface SQLQuery
columnAlias
- The column alias in the result-set to be processed as a scalar resulttype
- The Hibernate type as which to treat the value.
this
, for method chainingpublic SQLQuery addScalar(String columnAlias)
SQLQuery
<return-scalar/>
in hbm.xml
or ColumnResult
addScalar
in interface SQLQuery
columnAlias
- The column alias in the result-set to be processed as a scalar result
this
, for method chainingpublic SQLQuery.RootReturn addRoot(String tableAlias, String entityName)
SQLQuery
SQLQuery.RootReturn
to allow further definition
addRoot
in interface SQLQuery
tableAlias
- The SQL table alias to map to this entityentityName
- The name of the entity.
public SQLQuery.RootReturn addRoot(String tableAlias, Class entityType)
SQLQuery
SQLQuery.RootReturn
to allow further definition
addRoot
in interface SQLQuery
tableAlias
- The SQL table alias to map to this entityentityType
- The java type of the entity.
public SQLQuery addEntity(String entityName)
SQLQuery
SQLQuery.addRoot(java.lang.String, java.lang.String)
if you need further control of the mapping
addEntity
in interface SQLQuery
entityName
- The entity name that is the root return of the query.
this
, for method chainingpublic SQLQuery addEntity(String alias, String entityName)
SQLQuery
addEntity
in interface SQLQuery
alias
- The SQL table aliasentityName
- The entity name
this
, for method chainingpublic SQLQuery addEntity(String alias, String entityName, LockMode lockMode)
SQLQuery
addEntity
in interface SQLQuery
alias
- The SQL table aliasentityName
- The entity namelockMode
- The lock mode for this return.
this
, for method chainingpublic SQLQuery addEntity(Class entityType)
SQLQuery
addEntity
in interface SQLQuery
entityType
- The java type of the entity to add as a root
this
, for method chainingpublic SQLQuery addEntity(String alias, Class entityClass)
SQLQuery
addEntity
in interface SQLQuery
alias
- The SQL table aliasentityClass
- The java type of the entity to add as a root
this
, for method chainingpublic SQLQuery addEntity(String alias, Class entityClass, LockMode lockMode)
SQLQuery
addEntity
in interface SQLQuery
alias
- The SQL table aliasentityClass
- The entity namelockMode
- The lock mode for this return.
this
, for method chainingpublic 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
addJoin
in interface SQLQuery
alias
- The SQL table alias for the data to be mapped to this fetchpath
- The association path ([owner-alias].[property-name]).
this
, for method chainingpublic SQLQuery addJoin(String alias, String path, LockMode lockMode)
SQLQuery
addJoin
in interface SQLQuery
alias
- The SQL table alias for the data to be mapped to this fetchpath
- The association path ([owner-alias].[property-name]).lockMode
- The lock mode for this return.
this
, for method chainingpublic 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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |