openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mprud...@apache.org
Subject svn commit: r497276 - /incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/EqualExpression.java
Date Thu, 18 Jan 2007 01:26:57 GMT
Author: mprudhom
Date: Wed Jan 17 17:26:57 2007
New Revision: 497276

URL: http://svn.apache.org/viewvc?view=rev&rev=497276
Log:
Changed SQL generated by JPQL query "null = null" from "NULL IS NULL" to "1 = 1", since some
databases (e.g., DB2) dislike "NULL IS NULL", but everyone is OK with "1 = 1".

Modified:
    incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/EqualExpression.java

Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/EqualExpression.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/EqualExpression.java?view=diff&rev=497276&r1=497275&r2=497276
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/EqualExpression.java
(original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/EqualExpression.java
Wed Jan 17 17:26:57 2007
@@ -36,7 +36,7 @@
     public void appendTo(Select sel, ExpContext ctx, BinaryOpExpState bstate, 
         SQLBuffer buf, boolean val1Null, boolean val2Null) {
         if (val1Null && val2Null)
-            buf.appendValue(null).append(" IS ").appendValue(null);
+            buf.append("1 = 1");
         else if (val1Null || val2Null) {
             Val val = (val1Null) ? getValue2() : getValue1();
             ExpState state = (val1Null) ? bstate.state2 : bstate.state1;



Mime
View raw message