From 16c411c1377216e6043da15acd6e27b56253ab98 Mon Sep 17 00:00:00 2001 From: Diego Plentz Date: Fri, 5 Oct 2007 13:54:14 +0000 Subject: [PATCH] [HHH-1696] Add outer join support for aliases on DetachedCriteria git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@14064 1b8cb986-b30d-0410-93ca-fae66ebed9b2 --- .../hibernate/criterion/DetachedCriteria.java | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/hibernate/criterion/DetachedCriteria.java b/core/src/main/java/org/hibernate/criterion/DetachedCriteria.java index 801312bb39..7a6648e749 100755 --- a/core/src/main/java/org/hibernate/criterion/DetachedCriteria.java +++ b/core/src/main/java/org/hibernate/criterion/DetachedCriteria.java @@ -6,10 +6,10 @@ import java.io.Serializable; import org.hibernate.Criteria; import org.hibernate.FetchMode; import org.hibernate.HibernateException; +import org.hibernate.LockMode; import org.hibernate.Session; import org.hibernate.engine.SessionImplementor; import org.hibernate.impl.CriteriaImpl; -import org.hibernate.impl.SessionImpl; import org.hibernate.transform.ResultTransformer; /** @@ -122,4 +122,32 @@ public class DetachedCriteria implements CriteriaSpecification, Serializable { CriteriaImpl getCriteriaImpl() { return impl; } + + public DetachedCriteria createAlias(String associationPath, String alias, int joinType) throws HibernateException { + criteria.createAlias(associationPath, alias, joinType); + return this; + } + + public DetachedCriteria createCriteria(String associationPath, int joinType) throws HibernateException { + return new DetachedCriteria(impl, criteria.createCriteria(associationPath, joinType)); + } + + public DetachedCriteria createCriteria(String associationPath, String alias, int joinType) throws HibernateException { + return new DetachedCriteria(impl, criteria.createCriteria(associationPath, alias, joinType)); + } + + public DetachedCriteria setComment(String comment) { + criteria.setComment(comment); + return this; + } + + public DetachedCriteria setLockMode(LockMode lockMode) { + criteria.setLockMode(lockMode); + return this; + } + + public DetachedCriteria setLockMode(String alias, LockMode lockMode) { + criteria.setLockMode(alias, lockMode); + return this; + } }