| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface SQLQuery
Represents a "native sql" query and allows the user to define certain aspects about its execution, such as:
addSynchronizedQuerySpace(java.lang.String), addSynchronizedEntityName(java.lang.String) and
  addSynchronizedEntityClass(java.lang.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(java.lang.String)addEntity(java.lang.String), addRoot(java.lang.String, java.lang.String), addJoin(java.lang.String, java.lang.String), addFetch(java.lang.String, java.lang.String, java.lang.String) and addScalar(java.lang.String) methods
| Nested Class Summary | |
|---|---|
| static interface | SQLQuery.FetchReturnAllows access to further control how join fetch returns are mapped back from result sets | 
| static interface | SQLQuery.ReturnPropertyAllows access to further control how properties within a root or join fetch are mapped back from the result set. | 
| static interface | SQLQuery.RootReturnAllows access to further control how root returns are mapped back from result sets | 
| 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 tableAlias,
          Class entityType)Declare a "root" entity | 
|  SQLQuery | addEntity(String tableAlias,
          Class entityName,
          LockMode lockMode)Declare a "root" entity, specifying a lock mode | 
|  SQLQuery | addEntity(String tableAlias,
          String entityName)Declare a "root" entity | 
|  SQLQuery | addEntity(String tableAlias,
          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 tableAlias,
        String path)Declare a join fetch result. | 
|  SQLQuery | addJoin(String tableAlias,
        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.RootReturnto allow further definition | 
|  SQLQuery.RootReturn | addRoot(String tableAlias,
        String entityName)Add a new root return mapping, returning a SQLQuery.RootReturnto 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 | 
|  SQLQuery | setResultSetMapping(String name)Use a predefined named result-set mapping. | 
| Method Detail | 
|---|
SQLQuery addSynchronizedQuerySpace(String querySpace)
querySpace - The query space to be auto-flushed for this query.
SQLQuery addSynchronizedEntityName(String entityName)
                                   throws MappingException
addSynchronizedQuerySpace(java.lang.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
SQLQuery addSynchronizedEntityClass(Class entityClass)
                                    throws MappingException
addSynchronizedQuerySpace(java.lang.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 entitySQLQuery setResultSetMapping(String name)
<result-set/> element in a
 Hibernate hbm.xml file or through a SqlResultSetMapping annotation.
name - The name of the mapping to use.
SQLQuery addScalar(String columnAlias)
<return-scalar/> in hbm.xml or ColumnResult
columnAlias - The column alias in the result-set to be processed as a scalar result
this, for method chaining
SQLQuery addScalar(String columnAlias,
                   Type type)
<return-scalar/> in hbm.xml or ColumnResult
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 chaining
SQLQuery.RootReturn addRoot(String tableAlias,
                            String entityName)
SQLQuery.RootReturn to allow further definition
tableAlias - The SQL table alias to map to this entityentityName - The name of the entity.
SQLQuery.RootReturn addRoot(String tableAlias,
                            Class entityType)
SQLQuery.RootReturn to allow further definition
tableAlias - The SQL table alias to map to this entityentityType - The java type of the entity.
SQLQuery addEntity(String entityName)
addRoot(java.lang.String, java.lang.String) if you need further control of the mapping
entityName - The entity name that is the root return of the query.
this, for method chaining
SQLQuery addEntity(String tableAlias,
                   String entityName)
tableAlias - The SQL table aliasentityName - The entity name
this, for method chaining
SQLQuery addEntity(String tableAlias,
                   String entityName,
                   LockMode lockMode)
tableAlias - The SQL table aliasentityName - The entity namelockMode - The lock mode for this return.
this, for method chainingSQLQuery addEntity(Class entityType)
entityType - The java type of the entity to add as a root
this, for method chaining
SQLQuery addEntity(String tableAlias,
                   Class entityType)
tableAlias - The SQL table aliasentityType - The java type of the entity to add as a root
this, for method chaining
SQLQuery addEntity(String tableAlias,
                   Class entityName,
                   LockMode lockMode)
tableAlias - The SQL table aliasentityName - The entity namelockMode - The lock mode for this return.
this, for method chaining
SQLQuery.FetchReturn addFetch(String tableAlias,
                              String ownerTableAlias,
                              String joinPropertyName)
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.
SQLQuery addJoin(String tableAlias,
                 String path)
tableAlias - The SQL table alias for the data to be mapped to this fetchpath - The association path ([owner-alias].[property-name]).
this, for method chaining
SQLQuery addJoin(String tableAlias,
                 String ownerTableAlias,
                 String joinPropertyName)
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 chaining
SQLQuery addJoin(String tableAlias,
                 String path,
                 LockMode lockMode)
tableAlias - 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 chaining| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||