站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Hibernate 3.2.4 正式版 API 英文文档

SQLQuery (Hibernate API Documentation) - Hibernate 3.2.4 正式版 API 英文文档


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

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


addEntity

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


addEntity

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


addEntity

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


addEntity

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


addEntity

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


addJoin

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


addJoin

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


addScalar

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


addScalar

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


setResultSetMapping

public SQLQuery setResultSetMapping(String name)
Use a predefined named ResultSetMapping


addSynchronizedQuerySpace

public 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

public 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

public 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.