diff options
author | MakotoHirano <the.meat.of.zudoh.4kg@gmail.com> | 2016-11-18 17:35:45 +0900 |
---|---|---|
committer | MakotoHirano <the.meat.of.zudoh.4kg@gmail.com> | 2016-11-18 17:35:45 +0900 |
commit | c01feb79be8ca444a704dc20b0859295289fd524 (patch) | |
tree | dd73215ebea94cec0fd24ba7407364774c21f407 | |
parent | bfdf47b10d0b23063ad6ed0f9b9705868e37dda2 (diff) | |
download | iciql-c01feb79be8ca444a704dc20b0859295289fd524.tar.gz iciql-c01feb79be8ca444a704dc20b0859295289fd524.zip |
fix query can automatically treat null clause depends on value
-rw-r--r-- | src/main/java/com/iciql/QueryCondition.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/com/iciql/QueryCondition.java b/src/main/java/com/iciql/QueryCondition.java index fce66af..56de976 100644 --- a/src/main/java/com/iciql/QueryCondition.java +++ b/src/main/java/com/iciql/QueryCondition.java @@ -60,7 +60,11 @@ public class QueryCondition<T, A> { } public QueryWhere<T> is(A y) { - query.addConditionToken(new Condition<A>(x, y, CompareType.EQUAL)); + if (y == null) { + query.addConditionToken(new Condition<A>(x, CompareType.IS_NULL)); + } else { + query.addConditionToken(new Condition<A>(x, y, CompareType.EQUAL)); + } return new QueryWhere<T>(query); } |