当前页面:
在线文档首页 >
Hibernate 3.2.4 正式版 API 英文文档
DetachedCriteria (Hibernate API Documentation) - Hibernate 3.2.4 正式版 API 英文文档
org.hibernate.criterion
Class DetachedCriteria
java.lang.Object
org.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
DetachedCriteria
protected DetachedCriteria(String entityName)
DetachedCriteria
protected DetachedCriteria(String entityName,
String alias)
DetachedCriteria
protected DetachedCriteria(CriteriaImpl impl,
Criteria criteria)
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()