cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From and...@apache.org
Subject svn commit: r931920 - in /cayenne/main/branches/STABLE-3.0: docs/doc/src/main/resources/ framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/parser/ framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/exp/
Date Thu, 08 Apr 2010 13:03:12 GMT
Author: andrey
Date: Thu Apr  8 13:03:12 2010
New Revision: 931920

URL: http://svn.apache.org/viewvc?rev=931920&view=rev
Log:
CAY-1417 ExpressionFactory.noMatchExp.toEJBQL() produces incorrect output

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/java/org/apache/cayenne/exp/parser/ASTNotEqual.java
    cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/exp/ExpressionTest.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=931920&r1=931919&r2=931920&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 Apr
 8 13:03:12 2010
@@ -15,6 +15,7 @@ Date: 
 Bug Fixes Since 3.0-final:
 
 CAY-1354 Wrong Types mapping for selected values in Row Queries
+CAY-1416 ExpressionFactory.noMatchExp.toEJBQL() produces incorrect output
 CAY-1417 EJBQL doesn't support null numeric parameters
 
 ----------------------------------

Modified: cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/parser/ASTNotEqual.java
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/parser/ASTNotEqual.java?rev=931920&r1=931919&r2=931920&view=diff
==============================================================================
--- cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/parser/ASTNotEqual.java
(original)
+++ cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/parser/ASTNotEqual.java
Thu Apr  8 13:03:12 2010
@@ -76,7 +76,7 @@ public class ASTNotEqual extends Conditi
     		//for ejbql, we need "is not null" instead of "!= null"
     		return "is not";
     	}
-    	return getExpressionOperator(index);
+    	return "<>";
     }
 
     @Override

Modified: cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/exp/ExpressionTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/exp/ExpressionTest.java?rev=931920&r1=931919&r2=931920&view=diff
==============================================================================
--- cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/exp/ExpressionTest.java
(original)
+++ cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/exp/ExpressionTest.java
Thu Apr  8 13:03:12 2010
@@ -23,11 +23,11 @@ import java.io.PrintWriter;
 import java.io.StringWriter;
 import java.util.Collections;
 
+import junit.framework.TestCase;
+
 import org.apache.art.Artist;
 import org.apache.cayenne.ObjectId;
 
-import junit.framework.TestCase;
-
 /**
  */
 public class ExpressionTest extends TestCase {
@@ -125,4 +125,18 @@ public class ExpressionTest extends Test
 
         assertEquals("x.artist = 1", ejbql);
     }
+    
+    public void testEncodeAsEJBQLNotEquals() {
+
+        Expression e = Expression.fromString("artistName != 'bla'");
+
+        StringWriter buffer = new StringWriter();
+        PrintWriter pw = new PrintWriter(buffer);
+        e.encodeAsEJBQL(pw, "x");
+        pw.close();
+        buffer.flush();
+        String ejbql = buffer.toString();
+
+        assertEquals("x.artistName <> 'bla'", ejbql);
+    }
 }



Mime
View raw message