From 9d30d4819e7b0ea84e2f9de67ae2a2bfb2531676 Mon Sep 17 00:00:00 2001 From: Fay Wang Date: Thu, 14 May 2009 22:52:03 +0000 Subject: [PATCH] OPENJPA-1013: IS EMPTY/SIZE() support for criteria query git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@774955 13f79535-47bb-0310-9956-ffa450edef68 --- .../openjpa/persistence/criteria/TestTypesafeCriteria.java | 2 -- .../java/org/apache/openjpa/persistence/criteria/PathImpl.java | 3 +-- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/TestTypesafeCriteria.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/TestTypesafeCriteria.java index e43db11ae..08727f7aa 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/TestTypesafeCriteria.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/TestTypesafeCriteria.java @@ -273,7 +273,6 @@ public class TestTypesafeCriteria extends SQLListenerTestCase { assertEquivalence(q, jpql); } - @AllowFailure public void testRestrictQueryResult2() { String jpql = "SELECT o FROM Order o WHERE o.lineItems IS EMPTY"; CriteriaQuery q = cb.create(); @@ -339,7 +338,6 @@ public class TestTypesafeCriteria extends SQLListenerTestCase { assertEquivalence(q, jpql); } - @AllowFailure public void testExpression5() { String jpql = "SELECT SIZE(d.employees) FROM Department d " + "WHERE d.name = 'Sales'"; diff --git a/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/PathImpl.java b/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/PathImpl.java index fa6fb309b..6af94b427 100644 --- a/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/PathImpl.java +++ b/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/PathImpl.java @@ -83,8 +83,7 @@ public class PathImpl extends ExpressionImpl implements Path { } public Expression get(AbstractCollection collection) { - // TODO Auto-generated method stub - throw new AbstractMethodError(); + return new PathImpl(this, (Members.BaseCollection) collection); } public Expression get(Map collection) {