From 070833c10726f9deb43641d48a4971ed7256a8d1 Mon Sep 17 00:00:00 2001 From: Gail Badner Date: Tue, 25 Oct 2011 12:35:27 -0700 Subject: [PATCH] HH-6771 : Test failure on Oracle due to ORDER BY in subquery --- .../org/hibernate/test/criteria/CriteriaQueryTest.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hibernate-core/src/matrix/java/org/hibernate/test/criteria/CriteriaQueryTest.java b/hibernate-core/src/matrix/java/org/hibernate/test/criteria/CriteriaQueryTest.java index 471b651ad2..b2125a356d 100755 --- a/hibernate-core/src/matrix/java/org/hibernate/test/criteria/CriteriaQueryTest.java +++ b/hibernate-core/src/matrix/java/org/hibernate/test/criteria/CriteriaQueryTest.java @@ -50,6 +50,7 @@ import org.hibernate.criterion.Projections; import org.hibernate.criterion.Property; import org.hibernate.criterion.Restrictions; import org.hibernate.criterion.Subqueries; +import org.hibernate.dialect.Oracle8iDialect; import org.hibernate.dialect.SQLServerDialect; import org.hibernate.exception.SQLGrammarException; import org.hibernate.internal.util.SerializationHelper; @@ -213,8 +214,11 @@ public class CriteriaQueryTest extends BaseCoreFunctionalTestCase { dc4.getExecutableCriteria( session ).list(); - // SQL Server doesn't normally support ORDER BY in subqueries... - if (!(getDialect() instanceof SQLServerDialect)) dc4.getExecutableCriteria(session).addOrder(Order.asc("stname")).list(); + // SQL Server and Oracle doesn't normally support ORDER BY in subqueries... + if ( !( getDialect() instanceof SQLServerDialect ) && + ! ( getDialect() instanceof Oracle8iDialect ) ) { + dc4.getExecutableCriteria(session).addOrder(Order.asc("stname")).list(); + } session.createCriteria(Enrolment.class, "e") .add( Subqueries.eq("Gavin King", dc4) )