cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1143266 - /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextEJBQLConditionsTest.java
Date Wed, 06 Jul 2011 06:59:33 GMT
Author: aadamchik
Date: Wed Jul  6 06:59:32 2011
New Revision: 1143266

URL: http://svn.apache.org/viewvc?rev=1143266&view=rev
Log:
CAY-1514 ClassCastException when EJQLQuery parameters is null.

test.patch by Dzmitry Kazimirchyk

Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextEJBQLConditionsTest.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextEJBQLConditionsTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextEJBQLConditionsTest.java?rev=1143266&r1=1143265&r2=1143266&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextEJBQLConditionsTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextEJBQLConditionsTest.java
Wed Jul  6 06:59:32 2011
@@ -246,6 +246,21 @@ public class DataContextEJBQLConditionsT
 
         assertTrue(ids.contains(new Integer(33005)));
     }
+    
+    public void testLikeNullParameter() {
+        Artist a1 = context.newObject(Artist.class);
+        a1.setArtistName("a1");
+        a1.setDateOfBirth(null);
+        context.commitChanges();
+        
+        EJBQLQuery eq1 = new EJBQLQuery("select a from Artist a where a.dateOfBirth like
:param");
+        eq1.setParameter("param", null);
+        assertNotNull(Cayenne.objectForQuery(context, eq1));
+        
+        EJBQLQuery eq2 = new EJBQLQuery("select a from Artist a where a.dateOfBirth like
?1");
+        eq2.setParameter(1, null);
+        assertNotNull(Cayenne.objectForQuery(context, eq2));
+    }
 
     public void testIn() throws Exception {
         createInDataSet();



Mime
View raw message