aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMakotoHirano <the.meat.of.zudoh.4kg@gmail.com>2016-11-18 17:35:45 +0900
committerMakotoHirano <the.meat.of.zudoh.4kg@gmail.com>2016-11-18 17:35:45 +0900
commitc01feb79be8ca444a704dc20b0859295289fd524 (patch)
treedd73215ebea94cec0fd24ba7407364774c21f407
parentbfdf47b10d0b23063ad6ed0f9b9705868e37dda2 (diff)
downloadiciql-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.java6
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);
}