FileDocCategorySizeDatePackage
DetachedCriteria.javaAPI DocHibernate 3.2.53593Mon Dec 05 20:35:50 GMT 2005org.hibernate.criterion

DetachedCriteria

public class DetachedCriteria extends Object implements Serializable, CriteriaSpecification
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.
see
org.hibernate.Criteria
author
Gavin King

Fields Summary
private final org.hibernate.impl.CriteriaImpl
impl
private final org.hibernate.Criteria
criteria
Constructors Summary
protected DetachedCriteria(String entityName)

		impl = new CriteriaImpl(entityName, null);
		criteria = impl;
	
protected DetachedCriteria(String entityName, String alias)

		impl = new CriteriaImpl(entityName, alias, null);
		criteria = impl;
	
protected DetachedCriteria(org.hibernate.impl.CriteriaImpl impl, org.hibernate.Criteria criteria)

		this.impl = impl;
		this.criteria = criteria;
	
Methods Summary
public org.hibernate.criterion.DetachedCriteriaadd(Criterion criterion)

		criteria.add(criterion);
		return this;
	
public org.hibernate.criterion.DetachedCriteriaaddOrder(Order order)

		criteria.addOrder(order);
		return this;
	
public org.hibernate.criterion.DetachedCriteriacreateAlias(java.lang.String associationPath, java.lang.String alias)

		criteria.createAlias(associationPath, alias);
		return this;
	
public org.hibernate.criterion.DetachedCriteriacreateCriteria(java.lang.String associationPath, java.lang.String alias)

		return new DetachedCriteria( impl, criteria.createCriteria(associationPath) );
	
public org.hibernate.criterion.DetachedCriteriacreateCriteria(java.lang.String associationPath)

		return new DetachedCriteria( impl, criteria.createCriteria(associationPath) );
	
public static org.hibernate.criterion.DetachedCriteriaforClass(java.lang.Class clazz)

		return new DetachedCriteria( clazz.getName() );
	
public static org.hibernate.criterion.DetachedCriteriaforClass(java.lang.Class clazz, java.lang.String alias)

		return new DetachedCriteria( clazz.getName() , alias );
	
public static org.hibernate.criterion.DetachedCriteriaforEntityName(java.lang.String entityName)

		return new DetachedCriteria(entityName);
	
public static org.hibernate.criterion.DetachedCriteriaforEntityName(java.lang.String entityName, java.lang.String alias)

		return new DetachedCriteria(entityName, alias);
	
public java.lang.StringgetAlias()

		return criteria.getAlias();
	
org.hibernate.impl.CriteriaImplgetCriteriaImpl()

		return impl;
	
public org.hibernate.CriteriagetExecutableCriteria(org.hibernate.Session session)
Get an executable instance of Criteria, to actually run the query.

		impl.setSession( ( SessionImplementor ) session );
		return impl;
	
public org.hibernate.criterion.DetachedCriteriasetFetchMode(java.lang.String associationPath, org.hibernate.FetchMode mode)

		criteria.setFetchMode(associationPath, mode);
		return this;
	
public org.hibernate.criterion.DetachedCriteriasetProjection(Projection projection)

		criteria.setProjection(projection);
		return this;
	
public org.hibernate.criterion.DetachedCriteriasetResultTransformer(org.hibernate.transform.ResultTransformer resultTransformer)

		criteria.setResultTransformer(resultTransformer);
		return this;
	
public java.lang.StringtoString()

		return "DetachableCriteria(" + criteria.toString() + ')";