org.hibernate.SQLQuery |
Known Indirect Subclasses |
Represents a "native sql" query and allows the user to define certain aspects about its execution, such as:
addSynchronizedQuerySpace(String)
, addSynchronizedEntityName(String)
and
addSynchronizedEntityClass(Class)
. This allows Hibernate to properly know how to deal with auto-flush checking
as well as cached query results if the results of the query are being cached.
setResultSetMapping(String)
addEntity(Class)
, addRoot(String, Class)
, addJoin(String, String)
, addFetch(String, String, String)
and addScalar(String)
methodsNested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
SQLQuery.FetchReturn | Allows access to further control how join fetch returns are mapped back from result sets | ||||||||||
SQLQuery.ReturnProperty | Allows access to further control how properties within a root or join fetch are mapped back from the result set. | ||||||||||
SQLQuery.RootReturn | Allows access to further control how root returns are mapped back from result sets |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Declare a "root" entity
| |||||||||||
Declare a "root" entity, specifying a lock mode
| |||||||||||
Declare a "root" entity, without specifying an alias.
| |||||||||||
Declare a "root" entity
| |||||||||||
Declare a "root" entity, specifying a lock mode
| |||||||||||
Declare a "root" entity, without specifying an alias.
| |||||||||||
Declare a join fetch result.
| |||||||||||
Declare a join fetch result.
| |||||||||||
Declare a join fetch result, specifying a lock mode
| |||||||||||
Declare a join fetch result.
| |||||||||||
Add a new root return mapping, returning a
SQLQuery.RootReturn to allow further definition | |||||||||||
Add a new root return mapping, returning a
SQLQuery.RootReturn to allow further definition | |||||||||||
Declare a scalar query result.
| |||||||||||
Declare a scalar query result.
| |||||||||||
Adds an entity for (a) auto-flush checking and (b) query result cache invalidation checking.
| |||||||||||
Adds an entity name for (a) auto-flush checking and (b) query result cache invalidation checking.
| |||||||||||
Adds a query space (table name) for (a) auto-flush checking and (b) query result cache invalidation checking
| |||||||||||
Use a predefined named result-set mapping.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
org.hibernate.Query
|
Declare a "root" entity
tableAlias | The SQL table alias |
---|---|
entityType | The java type of the entity to add as a root |
this
, for method chaining
Declare a "root" entity, specifying a lock mode
tableAlias | The SQL table alias |
---|---|
entityName | The entity name |
lockMode | The lock mode for this return. |
this
, for method chaining
Declare a "root" entity, without specifying an alias. The expectation here is that the table alias is the same as the unqualified entity name
UseaddRoot(String, Class)
if you need further control of the mappingentityName | The entity name that is the root return of the query. |
---|
this
, for method chaining
Declare a "root" entity
tableAlias | The SQL table alias |
---|---|
entityName | The entity name |
this
, for method chaining
Declare a "root" entity, specifying a lock mode
tableAlias | The SQL table alias |
---|---|
entityName | The entity name |
lockMode | The lock mode for this return. |
this
, for method chaining
Declare a "root" entity, without specifying an alias. The expectation here is that the table alias is the same as the unqualified entity name
entityType | The java type of the entity to add as a root |
---|
this
, for method chaining
Declare a join fetch result.
tableAlias | The SQL table alias for the data to be mapped to this fetch |
---|---|
ownerTableAlias | Identify the table alias of the owner of this association. Should match the alias of a previously added root or fetch |
joinPropertyName | The name of the property being join fetched. |
Declare a join fetch result.
tableAlias | The SQL table alias for the data to be mapped to this fetch |
---|---|
ownerTableAlias | Identify the table alias of the owner of this association. Should match the alias of a previously added root or fetch |
joinPropertyName | The name of the property being join fetched. |
this
, for method chainingDeclare a join fetch result, specifying a lock mode
tableAlias | The SQL table alias for the data to be mapped to this fetch |
---|---|
path | The association path ([owner-alias].[property-name]). |
lockMode | The lock mode for this return. |
this
, for method chaining
Declare a join fetch result.
tableAlias | The SQL table alias for the data to be mapped to this fetch |
---|---|
path | The association path ([owner-alias].[property-name]). |
this
, for method chaining
Add a new root return mapping, returning a SQLQuery.RootReturn
to allow further definition
tableAlias | The SQL table alias to map to this entity |
---|---|
entityName | The name of the entity. |
Add a new root return mapping, returning a SQLQuery.RootReturn
to allow further definition
tableAlias | The SQL table alias to map to this entity |
---|---|
entityType | The java type of the entity. |
Declare a scalar query result.
Functions like<return-scalar/>
in hbm.xml
or javax.persistence.ColumnResultcolumnAlias | The column alias in the result-set to be processed as a scalar result |
---|---|
type | The Hibernate type as which to treat the value. |
this
, for method chaining
Declare a scalar query result. Hibernate will attempt to automatically detect the underlying type.
Functions like<return-scalar/>
in hbm.xml
or javax.persistence.ColumnResultcolumnAlias | The column alias in the result-set to be processed as a scalar result |
---|
this
, for method chaining
Adds an entity for (a) auto-flush checking and (b) query result cache invalidation checking. Same as
addSynchronizedQuerySpace(String)
for all tables associated with the given entity.
entityClass | The class of the entity upon whose defined query spaces we should additionally synchronize. |
---|
MappingException | Indicates the given class could not be resolved as an entity |
---|
Adds an entity name for (a) auto-flush checking and (b) query result cache invalidation checking. Same as
addSynchronizedQuerySpace(String)
for all tables associated with the given entity.
entityName | The name of the entity upon whose defined query spaces we should additionally synchronize. |
---|
MappingException | Indicates the given name could not be resolved as an entity |
---|
Adds a query space (table name) for (a) auto-flush checking and (b) query result cache invalidation checking
querySpace | The query space to be auto-flushed for this query. |
---|
Use a predefined named result-set mapping. This might be defined by a <result-set/>
element in a
Hibernate hbm.xml file or through a javax.persistence.SqlResultSetMapping annotation.
name | The name of the mapping to use. |
---|