cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From torehal...@apache.org
Subject svn commit: r470563 - /incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/trans/QualifierTranslator.java
Date Thu, 02 Nov 2006 22:20:50 GMT
Author: torehalset
Date: Thu Nov  2 14:20:50 2006
New Revision: 470563

URL: http://svn.apache.org/viewvc?view=rev&rev=470563
Log:
CAY-696 - true/false in expression
 use "(1 = 0)" instead of "false" as it works on more databases

Modified:
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/trans/QualifierTranslator.java

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/trans/QualifierTranslator.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/trans/QualifierTranslator.java?view=diff&rev=470563&r1=470562&r2=470563
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/trans/QualifierTranslator.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/trans/QualifierTranslator.java
Thu Nov  2 14:20:50 2006
@@ -288,10 +288,12 @@
         }
         
         if (count == 0) {
-            if (node.getType() == Expression.TRUE || node.getType() == Expression.FALSE)
{
-                // TODO: some databases do not handle true/false
-                // "true" or "false"
-                qualBuf.append(node.evaluate(null).toString());
+            // not all databases handle true/false
+            if (node.getType() == Expression.TRUE) {
+                qualBuf.append("1 = 1");
+            }
+            if (node.getType() == Expression.FALSE) {
+                qualBuf.append("1 = 0");
             }
         }
 
@@ -358,12 +360,6 @@
             return false;
 
         if (node.getType() == Expression.DB_PATH)
-            return false;
-        
-        if (node.getType() == Expression.TRUE)
-            return false;
-
-        if (node.getType() == Expression.FALSE)
             return false;
         
         return true;



Mime
View raw message