Changed SQL generated by JPQL query "null <> null" from "NULL IS NOT NULL" to "1 <> 1", since some databases (e.g., DB2) dislike "NULL IS NOT NULL", but everyone is OK with "1 <> 1".

git-svn-id: https://svn.apache.org/repos/asf/incubator/openjpa/trunk@497279 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Marc Prud'hommeaux 2007-01-18 01:30:45 +00:00
parent f0be9e1af1
commit fa5eb3a7af
1 changed files with 1 additions and 1 deletions

View File

@ -36,7 +36,7 @@ class NotEqualExpression
public void appendTo(Select sel, ExpContext ctx, BinaryOpExpState bstate, public void appendTo(Select sel, ExpContext ctx, BinaryOpExpState bstate,
SQLBuffer buf, boolean val1Null, boolean val2Null) { SQLBuffer buf, boolean val1Null, boolean val2Null) {
if (val1Null && val2Null) if (val1Null && val2Null)
buf.appendValue(null).append(" IS NOT ").appendValue(null); buf.append("1 <> 1");
else if (val1Null || val2Null) { else if (val1Null || val2Null) {
Val val = (val1Null) ? getValue2() : getValue1(); Val val = (val1Null) ? getValue2() : getValue1();
ExpState state = (val1Null) ? bstate.state2 : bstate.state1; ExpState state = (val1Null) ? bstate.state2 : bstate.state1;