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

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


org.hibernate.criterion
Class DetachedCriteria

java.lang.Object
  extended byorg.hibernate.criterion.DetachedCriteria
All Implemented Interfaces:
CriteriaSpecification, Serializable

public class DetachedCriteria
extends Object
implements CriteriaSpecification, Serializable

Some applications need to create criteria queries in "detached mode", where the Hibernate session is not available. This class may be instantiated anywhere, and then a Criteria may be obtained by passing a session to getExecutableCriteria(). All methods have the same semantics and behavior as the corresponding methods of the Criteria interface.

Author:
Gavin King
See Also:
Criteria, Serialized Form

Field Summary
 
Fields inherited from interface org.hibernate.criterion.CriteriaSpecification
ALIAS_TO_ENTITY_MAP, DISTINCT_ROOT_ENTITY, FULL_JOIN, INNER_JOIN, LEFT_JOIN, PROJECTION, ROOT_ALIAS, ROOT_ENTITY
 
Constructor Summary
protected DetachedCriteria(CriteriaImpl impl, Criteria criteria)
           
protected DetachedCriteria(String entityName)
           
protected DetachedCriteria(String entityName, String alias)
           
 
Method Summary
 DetachedCriteria add(Criterion criterion)
           
 DetachedCriteria addOrder(Order order)
           
 DetachedCriteria createAlias(String associationPath, String alias)
           
 DetachedCriteria createCriteria(String associationPath)
           
 DetachedCriteria createCriteria(String associationPath, String alias)
           
static DetachedCriteria forClass(Class clazz)
           
static DetachedCriteria forClass(Class clazz, String alias)
           
static DetachedCriteria forEntityName(String entityName)
           
static DetachedCriteria forEntityName(String entityName, String alias)
           
 String getAlias()
           
 Criteria getExecutableCriteria(Session session)
          Get an executable instance of Criteria, to actually run the query.
 DetachedCriteria setFetchMode(String associationPath, FetchMode mode)
           
 DetachedCriteria setProjection(Projection projection)
           
 DetachedCriteria setResultTransformer(ResultTransformer resultTransformer)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DetachedCriteria

protected DetachedCriteria(String entityName)

DetachedCriteria

protected DetachedCriteria(String entityName,
                           String alias)

DetachedCriteria

protected DetachedCriteria(CriteriaImpl impl,
                           Criteria criteria)
Method Detail

getExecutableCriteria

public Criteria getExecutableCriteria(Session session)
Get an executable instance of Criteria, to actually run the query.


forEntityName

public static DetachedCriteria forEntityName(String entityName)

forEntityName

public static DetachedCriteria forEntityName(String entityName,
                                             String alias)

forClass

public static DetachedCriteria forClass(Class clazz)

forClass

public static DetachedCriteria forClass(Class clazz,
                                        String alias)

add

public DetachedCriteria add(Criterion criterion)

addOrder

public DetachedCriteria addOrder(Order order)

createAlias

public DetachedCriteria createAlias(String associationPath,
                                    String alias)
                             throws HibernateException
Throws:
HibernateException

createCriteria

public DetachedCriteria createCriteria(String associationPath,
                                       String alias)
                                throws HibernateException
Throws:
HibernateException

createCriteria

public DetachedCriteria createCriteria(String associationPath)
                                throws HibernateException
Throws:
HibernateException

getAlias

public String getAlias()

setFetchMode

public DetachedCriteria setFetchMode(String associationPath,
                                     FetchMode mode)
                              throws HibernateException
Throws:
HibernateException

setProjection

public DetachedCriteria setProjection(Projection projection)

setResultTransformer

public DetachedCriteria setResultTransformer(ResultTransformer resultTransformer)

toString

public String toString()