cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r964537 - in /cayenne/main/branches/STABLE-3.0: docs/doc/src/main/resources/ framework/cayenne-jdk1.5-unpublished/src/main/jjtree/org/apache/cayenne/ejbql/ framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/
Date Thu, 15 Jul 2010 18:56:42 GMT
Author: aadamchik
Date: Thu Jul 15 18:56:41 2010
New Revision: 964537

URL: http://svn.apache.org/viewvc?rev=964537&view=rev
Log:
CAY-1426 EJBQL: ESCAPE fails after positional parameter

* patch by Xenia Khailenko

Modified:
    cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/RELEASE-NOTES.txt
    cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/jjtree/org/apache/cayenne/ejbql/EJBQLParser.jjt
    cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextEJBQLConditionsTest.java

Modified: cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/RELEASE-NOTES.txt
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/RELEASE-NOTES.txt?rev=964537&r1=964536&r2=964537&view=diff
==============================================================================
--- cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/RELEASE-NOTES.txt (original)
+++ cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/RELEASE-NOTES.txt Thu Jul
15 18:56:41 2010
@@ -19,6 +19,7 @@ CAY-1380 Support for Escaped LIKE Clause
 CAY-1402 Ability to use Terminating "@size" in Nested Properties Against Collections
 CAY-1416 ExpressionFactory.noMatchExp.toEJBQL() produces incorrect output
 CAY-1417 EJBQL doesn't support null numeric parameters
+CAY-1426 EJBQL: ESCAPE fails after positional parameter
 CAY-1452 EJBQL query scalar result is not supported on ROP client
 CAY-1455 "NULL" JDBC type is shown for DbAttribute data types in the Modeler
 CAY-1458 Document Vertical Inheritance

Modified: cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/jjtree/org/apache/cayenne/ejbql/EJBQLParser.jjt
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/jjtree/org/apache/cayenne/ejbql/EJBQLParser.jjt?rev=964537&r1=964536&r2=964537&view=diff
==============================================================================
--- cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/jjtree/org/apache/cayenne/ejbql/EJBQLParser.jjt
(original)
+++ cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/jjtree/org/apache/cayenne/ejbql/EJBQLParser.jjt
Thu Jul 15 18:56:41 2010
@@ -1208,7 +1208,7 @@ void positional_input_parameter() #Posit
 
 void pattern_value() #PatternValue : { }
 {
-	input_parameter() | string_literal()
+	(input_parameter() | string_literal())
 	[(<ESCAPE> escape_character())]
 }
 

Modified: cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextEJBQLConditionsTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextEJBQLConditionsTest.java?rev=964537&r1=964536&r2=964537&view=diff
==============================================================================
--- cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextEJBQLConditionsTest.java
(original)
+++ cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextEJBQLConditionsTest.java
Thu Jul 15 18:56:41 2010
@@ -166,6 +166,27 @@ public class DataContextEJBQLConditionsT
         assertTrue(ids.contains(new Integer(33005)));
     }
 
+    public void testLikeEscape_LikeParameter() throws Exception {
+        createTestData("prepareLike");
+
+        // test for CAY-1426
+        String ejbql = "SELECT p FROM Painting p WHERE p.paintingTitle LIKE ?1 ESCAPE 'X'";
+
+        EJBQLQuery query = new EJBQLQuery(ejbql);
+        query.setParameter(1, "X_DDDD");
+        List<?> objects = createDataContext().performQuery(query);
+        assertEquals(1, objects.size());
+
+        Set<Object> ids = new HashSet<Object>();
+        Iterator<?> it = objects.iterator();
+        while (it.hasNext()) {
+            Object id = DataObjectUtils.pkForObject((Persistent) it.next());
+            ids.add(id);
+        }
+
+        assertTrue(ids.contains(new Integer(33005)));
+    }
+
     public void testIn() throws Exception {
         createTestData("prepareIn");
 



Mime
View raw message