openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ppod...@apache.org
Subject svn commit: r884265 - /openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/TestTypesafeCriteria.java
Date Wed, 25 Nov 2009 20:52:37 GMT
Author: ppoddar
Date: Wed Nov 25 20:52:36 2009
New Revision: 884265

URL: http://svn.apache.org/viewvc?rev=884265&view=rev
Log:
Special comparison for two boolean constants

Modified:
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/TestTypesafeCriteria.java

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/TestTypesafeCriteria.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/TestTypesafeCriteria.java?rev=884265&r1=884264&r2=884265&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/TestTypesafeCriteria.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/TestTypesafeCriteria.java
Wed Nov 25 20:52:36 2009
@@ -40,6 +40,7 @@
 import javax.persistence.criteria.SetJoin;
 import javax.persistence.criteria.Subquery;
 import javax.persistence.metamodel.EntityType;
+import javax.persistence.metamodel.Metamodel;
 
 import org.apache.openjpa.persistence.test.AllowFailure;
 
@@ -1435,4 +1436,24 @@
         assertEquivalence(c, jpql);
         
     }
+    
+    public void testDisjunctionAsFalse() {
+        Metamodel mm = em.getMetamodel();
+
+        CriteriaQuery<Order> cquery = cb.createQuery(Order.class);
+        Root<Order> order = cquery.from(Order.class);
+        
+       EntityType<Order> Order_ = order.getModel();
+       EntityType<Customer> Customer_ = mm.entity(Customer.class);
+       cquery.where(cb.and(cb.equal(
+         order.get(Order_.getSingularAttribute("customer", Customer.class))
+                  .get(Customer_.getSingularAttribute("name", String.class)), "Robert E.
Bissett"),
+         cb.isFalse(cb.disjunction())));
+
+       cquery.distinct(true);
+
+       Query q = em.createQuery(cquery);
+
+       List result = q.getResultList();        
+    }
 }



Mime
View raw message