From 81f42693ddcd3e01c3a7e785c35ab9e0b869019e Mon Sep 17 00:00:00 2001 From: Gail Badner Date: Thu, 17 Oct 2019 12:04:19 -0700 Subject: [PATCH] HHH-13634 : Fix test case queries to order results (cherry picked from commit 93a07453f0cdf3e764832a22679c8642e3af6fb9) --- .../QueryScrollingWithInheritanceEagerManyToOneTest.java | 8 ++++---- ...ryScrollingWithInheritanceProxyEagerManyToOneTest.java | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/hibernate-core/src/test/java/org/hibernate/test/bytecode/enhancement/lazy/QueryScrollingWithInheritanceEagerManyToOneTest.java b/hibernate-core/src/test/java/org/hibernate/test/bytecode/enhancement/lazy/QueryScrollingWithInheritanceEagerManyToOneTest.java index d6b568266d..7fc33ef7ad 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/bytecode/enhancement/lazy/QueryScrollingWithInheritanceEagerManyToOneTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/bytecode/enhancement/lazy/QueryScrollingWithInheritanceEagerManyToOneTest.java @@ -81,7 +81,7 @@ public class QueryScrollingWithInheritanceEagerManyToOneTest extends BaseNonConf try { statelessSession.beginTransaction(); Query query = statelessSession.createQuery( - "select distinct e from Employee e left join fetch e.otherEntities", + "select distinct e from Employee e left join fetch e.otherEntities order by e.dept", Employee.class ); if ( getDialect() instanceof DB2Dialect ) { @@ -89,7 +89,7 @@ public class QueryScrollingWithInheritanceEagerManyToOneTest extends BaseNonConf FetchingScrollableResultsImp#next() in order to check if the ResultSet is empty calls ResultSet#isBeforeFirst() but the support for ResultSet#isBeforeFirst() is optional for ResultSets with a result set type of TYPE_FORWARD_ONLY and db2 does not support it. - */ + */ scrollableResults = query.scroll( ScrollMode.SCROLL_INSENSITIVE ); } else { @@ -143,7 +143,7 @@ public class QueryScrollingWithInheritanceEagerManyToOneTest extends BaseNonConf try { session.beginTransaction(); Query query = session.createQuery( - "select distinct e from Employee e left join fetch e.otherEntities", + "select distinct e from Employee e left join fetch e.otherEntities order by e.dept", Employee.class ); if ( getDialect() instanceof DB2Dialect ) { @@ -151,7 +151,7 @@ public class QueryScrollingWithInheritanceEagerManyToOneTest extends BaseNonConf FetchingScrollableResultsImp#next() in order to check if the ResultSet is empty calls ResultSet#isBeforeFirst() but the support for ResultSet#isBeforeFirst() is optional for ResultSets with a result set type of TYPE_FORWARD_ONLY and db2 does not support it. - */ + */ scrollableResults = query.scroll( ScrollMode.SCROLL_INSENSITIVE ); } else { diff --git a/hibernate-core/src/test/java/org/hibernate/test/bytecode/enhancement/lazy/proxy/QueryScrollingWithInheritanceProxyEagerManyToOneTest.java b/hibernate-core/src/test/java/org/hibernate/test/bytecode/enhancement/lazy/proxy/QueryScrollingWithInheritanceProxyEagerManyToOneTest.java index 88ef1c2f71..791ca4d17d 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/bytecode/enhancement/lazy/proxy/QueryScrollingWithInheritanceProxyEagerManyToOneTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/bytecode/enhancement/lazy/proxy/QueryScrollingWithInheritanceProxyEagerManyToOneTest.java @@ -81,7 +81,7 @@ public class QueryScrollingWithInheritanceProxyEagerManyToOneTest extends BaseNo try { statelessSession.beginTransaction(); Query query = statelessSession.createQuery( - "select distinct e from Employee e left join fetch e.otherEntities", + "select distinct e from Employee e left join fetch e.otherEntities order by e.dept", Employee.class ); if ( getDialect() instanceof DB2Dialect ) { @@ -89,7 +89,7 @@ public class QueryScrollingWithInheritanceProxyEagerManyToOneTest extends BaseNo FetchingScrollableResultsImp#next() in order to check if the ResultSet is empty calls ResultSet#isBeforeFirst() but the support for ResultSet#isBeforeFirst() is optional for ResultSets with a result set type of TYPE_FORWARD_ONLY and db2 does not support it. - */ + */ scrollableResults = query.scroll( ScrollMode.SCROLL_INSENSITIVE ); } else { @@ -145,7 +145,7 @@ public class QueryScrollingWithInheritanceProxyEagerManyToOneTest extends BaseNo try { session.beginTransaction(); Query query = session.createQuery( - "select distinct e from Employee e left join fetch e.otherEntities", + "select distinct e from Employee e left join fetch e.otherEntities order by e.dept", Employee.class ); if ( getDialect() instanceof DB2Dialect ) { @@ -153,7 +153,7 @@ public class QueryScrollingWithInheritanceProxyEagerManyToOneTest extends BaseNo FetchingScrollableResultsImp#next() in order to check if the ResultSet is empty calls ResultSet#isBeforeFirst() but the support for ResultSet#isBeforeFirst() is optional for ResultSets with a result set type of TYPE_FORWARD_ONLY and db2 does not support it. - */ + */ scrollableResults = query.scroll( ScrollMode.SCROLL_INSENSITIVE ); } else {