addSynchronizedQuerySpace, addSynchronizedEntityName and
addSynchronizedEntityClass. 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.
In terms of result-set mapping, there are 3 approaches to defining:
| Modifier and Type | Class and Description |
|---|---|
| public static interface | SQLQuery.FetchReturn
Allows access to further control how join fetch returns are mapped back from result sets |
| public static interface | SQLQuery.ReturnProperty
Allows access to further control how properties within a root or join fetch are mapped back from the result set. |
| public static interface | SQLQuery.RootReturn
Allows access to further control how root returns are mapped back from result sets |
| Modifier and Type | Method and Description |
|---|---|
| public SQLQuery | |
| public SQLQuery | |
| public SQLQuery | |
| public SQLQuery | |
| public SQLQuery | |
| public SQLQuery | |
| public SQLQuery. | Returns: The return config object for further control.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)Declare a join fetch result. |
| public SQLQuery | |
| public SQLQuery | Returns: this, for method chainingThe 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)Declare a join fetch result. |
| public SQLQuery | |
| public SQLQuery. | Returns: The return config object for further control.The SQL table alias to map to this entity tableAlias, String The name of the entity. entityName)Add a new root return mapping, returning a |
| public SQLQuery. | Returns: The return config object for further control.The SQL table alias to map to this entity tableAlias, Class<T> The java type of the entity. entityType)Add a new root return mapping, returning a |
| public SQLQuery | |
| public SQLQuery | |
| public SQLQuery | Returns: this, for method chainingThe class of the entity upon whose defined query spaces we should additionally synchronize. entityClass)Adds an entity for (a) auto-flush checking and (b) query result cache invalidation checking. |
| public SQLQuery | Returns: this, for method chainingThe name of the entity upon whose defined query spaces we should additionally synchronize. entityName)Adds an entity name for (a) auto-flush checking and (b) query result cache invalidation checking. |
| public SQLQuery | Returns: this, for method chainingThe query space to be auto-flushed for this query. querySpace)Adds a query space (table name) for (a) auto-flush checking and (b) query result cache invalidation checking |
| public SQLQuery | Returns: this, for method chainingThe name of the mapping to use. name)Use a predefined named result-set mapping. |
| addEntity | back to summary |
|---|---|
| public SQLQuery addEntity(String entityName) Declare a "root" entity, without specifying an alias. The expectation here is that the table alias is the same as the unqualified entity name
Use | |
| addEntity | back to summary |
|---|---|
| public SQLQuery addEntity(String tableAlias, String entityName) Declare a "root" entity | |
| addEntity | back to summary |
|---|---|
| public SQLQuery addEntity(String tableAlias, String entityName, LockMode lockMode) Declare a "root" entity, specifying a lock mode | |
| addEntity | back to summary |
|---|---|
| public SQLQuery addEntity(Class<T> entityType) Declare a "root" entity, without specifying an alias. The expectation here is that the table alias is the same as the unqualified entity name | |
| addEntity | back to summary |
|---|---|
| public SQLQuery addEntity(String tableAlias, Class<T> entityType) Declare a "root" entity | |
| addEntity | back to summary |
|---|---|
| public SQLQuery addEntity(String tableAlias, Class<T> entityName, LockMode lockMode) Declare a "root" entity, specifying a lock mode | |
| addFetch | back to summary |
|---|---|
| public SQLQuery. Declare a join fetch result.
| |
| addJoin | back to summary |
|---|---|
| public SQLQuery addJoin(String tableAlias, String path) Declare a join fetch result. | |
| addJoin | back to summary |
|---|---|
| public SQLQuery addJoin(String tableAlias, String ownerTableAlias, String joinPropertyName) Declare a join fetch result.
| |
| addJoin | back to summary |
|---|---|
| public SQLQuery addJoin(String tableAlias, String path, LockMode lockMode) Declare a join fetch result, specifying a lock mode | |
| addRoot | back to summary |
|---|---|
| public SQLQuery. Add a new root return mapping, returning a
| |
| addRoot | back to summary |
|---|---|
| public SQLQuery. Add a new root return mapping, returning a
| |
| addScalar | back to summary |
|---|---|
| public SQLQuery addScalar(String columnAlias) Declare a scalar query result. Hibernate will attempt to automatically detect the underlying type.
Functions like | |
| addScalar | back to summary |
|---|---|
| public SQLQuery addScalar(String columnAlias, Type type) Declare a scalar query result.
Functions like | |
| addSynchronizedEntityClass | back to summary |
|---|---|
| public SQLQuery addSynchronizedEntityClass(Class<T> entityClass) throws MappingException Adds an entity for (a) auto-flush checking and (b) query result cache invalidation checking. Same as
| |
| addSynchronizedEntityName | back to summary |
|---|---|
| public SQLQuery addSynchronizedEntityName(String entityName) throws MappingException Adds an entity name for (a) auto-flush checking and (b) query result cache invalidation checking. Same as
| |
| addSynchronizedQuerySpace | back to summary |
|---|---|
| public SQLQuery addSynchronizedQuerySpace(String querySpace) Adds a query space (table name) for (a) auto-flush checking and (b) query result cache invalidation checking | |
| setResultSetMapping | back to summary |
|---|---|
| public SQLQuery setResultSetMapping(String name) Use a predefined named result-set mapping. This might be defined by a | |
| Modifier and Type | Method and Description |
|---|---|
| public SQLQuery. | Returns: this, for method chainingThe name of the property. propertyName, String The name of the column columnAlias)Add a simple property-to-one-column mapping |
| public SQLQuery. | Returns: The config object for further control.The name of the property. propertyName)Add a property, presumably with more than one column. |
| public SQLQuery. | Returns: this, for method chainingThe new lock mode. lockMode)Set the lock mode for this return |
| addProperty | back to summary |
|---|---|
| public SQLQuery. Add a simple property-to-one-column mapping
| |
| addProperty | back to summary |
|---|---|
| public SQLQuery. Add a property, presumably with more than one column.
| |
| setLockMode | back to summary |
|---|---|
| public SQLQuery. Set the lock mode for this return
| |
| Modifier and Type | Method and Description |
|---|---|
| public SQLQuery. | Returns: this, for method chainingThe column alias. columnAlias)Add a column alias to this property mapping. |
| addColumnAlias | back to summary |
|---|---|
| public SQLQuery. Add a column alias to this property mapping.
| |
| Modifier and Type | Method and Description |
|---|---|
| public SQLQuery. | Returns: this, for method chainingThe name of the property. propertyName, String The name of the column columnAlias)Add a simple property-to-one-column mapping |
| public SQLQuery. | Returns: The config object for further control.The name of the property. propertyName)Add a property, presumably with more than one column. |
| public SQLQuery. | Returns: this, for method chainingThe discriminator column alias columnAlias)Name the column alias that identifies the entity's discriminator |
| public SQLQuery. | Returns: this, for method chainingThe new lock mode. lockMode)Set the lock mode for this return |
| addProperty | back to summary |
|---|---|
| public SQLQuery. Add a simple property-to-one-column mapping
| |
| addProperty | back to summary |
|---|---|
| public SQLQuery. Add a property, presumably with more than one column.
| |
| setDiscriminatorAlias | back to summary |
|---|---|
| public SQLQuery. Name the column alias that identifies the entity's discriminator
| |
| setLockMode | back to summary |
|---|---|
| public SQLQuery. Set the lock mode for this return
| |