cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r551636 - /cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLConditionTranslator.java
Date Thu, 28 Jun 2007 17:47:31 GMT
Author: aadamchik
Date: Thu Jun 28 10:47:30 2007
New Revision: 551636

URL: http://svn.apache.org/viewvc?view=rev&rev=551636
Log:
testing on Derby - null parameter handling requires this hack

Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLConditionTranslator.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLConditionTranslator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLConditionTranslator.java?view=diff&rev=551636&r1=551635&r2=551636
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLConditionTranslator.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLConditionTranslator.java
Thu Jun 28 10:47:30 2007
@@ -344,7 +344,14 @@
             context.append(" #bind($").append(boundName).append(")");
         }
         else {
-            context.append(" NULL");
+            // this is a hack to prevent execptions on DB's like Derby for expressions
+            // "X = NULL". The 'VARCHAR' parameter is totally bogus, but seems to work on
+            // all tested DB's... Also note what JPA spec, chapter 4.11 says: "Comparison
+            // or arithmetic operations with a NULL value always yield an unknown value."
+            
+            // TODO: andrus 6/28/2007 Ideally we should track the type of the current
+            // expression to provide a meaningful type.
+            context.append(" #bind($").append(boundName).append(" 'VARCHAR')");
         }
     }
 }



Mime
View raw message