mirror of https://github.com/apache/openjpa.git
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:
parent
f0be9e1af1
commit
fa5eb3a7af
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue