org.hibernate
Interface SQLQuery

All Superinterfaces:
Query
All Known Implementing Classes:
SQLQueryImpl

public interface SQLQuery
extends Query

Allows the user to declare the types and select list injection points of all entities returned by the query. Also allows declaration of the type and column alias of any scalar results of the query.

Author:
Gavin King

Method Summary
 SQLQuery addEntity(Class entityClass)
          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 addJoin(String alias, String path)
          Declare a "joined" entity
 SQLQuery addJoin(String alias, String path, LockMode lockMode)
          Declare a "joined" entity, specifying a lock mode
 SQLQuery addScalar(String columnAlias)
          Declare a scalar query.
 SQLQuery addScalar(String columnAlias, Type type)
          Declare a scalar query result
 SQLQuery addSynchronizedEntityClass(Class entityClass)
          Adds an entity name or auto-flush synchronization.
 SQLQuery addSynchronizedEntityName(String entityName)
          Adds an entity name or auto-flush synchronization.
 SQLQuery addSynchronizedQuerySpace(String querySpace)
          Adds a query space for auto-flush synchronization.
 SQLQuery setResultSetMapping(String name)
          Use a predefined named ResultSetMapping
 
Methods inherited from interface org.hibernate.Query
executeUpdate, getNamedParameters, getQueryString, getReturnAliases, getReturnTypes, iterate, list, scroll, scroll, 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, setLockMode, 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
 

Method Detail

addEntity

SQLQuery addEntity(String entityName)
Declare a "root" entity, without specifying an alias


addEntity

SQLQuery addEntity(String alias,
                   String entityName)
Declare a "root" entity


addEntity

SQLQuery addEntity(String alias,
                   String entityName,
                   LockMode lockMode)
Declare a "root" entity, specifying a lock mode


addEntity

SQLQuery addEntity(Class entityClass)
Declare a "root" entity, without specifying an alias


addEntity

SQLQuery addEntity(String alias,
                   Class entityClass)
Declare a "root" entity


addEntity

SQLQuery addEntity(String alias,
                   Class entityClass,
                   LockMode lockMode)
Declare a "root" entity, specifying a lock mode


addJoin

SQLQuery addJoin(String alias,
                 String path)
Declare a "joined" entity


addJoin

SQLQuery addJoin(String alias,
                 String path,
                 LockMode lockMode)
Declare a "joined" entity, specifying a lock mode


addScalar

SQLQuery addScalar(String columnAlias,
                   Type type)
Declare a scalar query result


addScalar

SQLQuery addScalar(String columnAlias)
Declare a scalar query. Hibernate will attempt to automatically detect the underlying type.


setResultSetMapping

SQLQuery setResultSetMapping(String name)
Use a predefined named ResultSetMapping


addSynchronizedQuerySpace

SQLQuery addSynchronizedQuerySpace(String querySpace)
Adds a query space for auto-flush synchronization.

Parameters:
querySpace - The query space to be auto-flushed for this query.
Returns:
this, for method chaning

addSynchronizedEntityName

SQLQuery addSynchronizedEntityName(String entityName)
                                   throws MappingException
Adds an entity name or auto-flush synchronization.

Parameters:
entityName - The name of the entity upon whose defined query spaces we should additionally synchronize.
Returns:
this, for method chaning
Throws:
MappingException - Indicates the given entity name could not be resolved.

addSynchronizedEntityClass

SQLQuery addSynchronizedEntityClass(Class entityClass)
                                    throws MappingException
Adds an entity name or auto-flush synchronization.

Parameters:
entityClass - The class of the entity upon whose defined query spaces we should additionally synchronize.
Returns:
this, for method chaning
Throws:
MappingException - Indicates the given entity class could not be resolved.