OPENJPA-1715: OpenJPA generates wrong SQL if a result variable that references an aggregate expression is used in ORDER BY clause

fix testcase.

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@961472 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Catalina Wei 2010-07-07 18:37:29 +00:00
parent ee83defe59
commit 90a54ac7e7
1 changed files with 5 additions and 1 deletions

View File

@ -83,7 +83,11 @@ public class TestJPQLScalarExpressions extends AbstractTestCase {
query.setFirstResult(1); query.setFirstResult(1);
query.setMaxResults(4); query.setMaxResults(4);
List<Object[]> rs = query.getResultList(); List<Object[]> rs = query.getResultList();
assertTrue((Long)((Object[]) rs.get(0))[1] > 0); Object val = ((Object[]) rs.get(0))[1];
if (val instanceof Integer)
assertTrue((Integer) val > 0);
else if (val instanceof Long)
assertTrue((Long) val > 0);
} }
} }