aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Moger <james.moger@gmail.com>2017-01-30 16:44:53 -0500
committerGitHub <noreply@github.com>2017-01-30 16:44:53 -0500
commitcf7ea9600595749065129d48fbdff6f781db87b3 (patch)
treec0dff3d8066994b49d4f852026ab9c8b693ca27d
parentbc293dc054baa486b703aef3bbbc3ff6b5391268 (diff)
parentc01feb79be8ca444a704dc20b0859295289fd524 (diff)
downloadiciql-cf7ea9600595749065129d48fbdff6f781db87b3.tar.gz
iciql-cf7ea9600595749065129d48fbdff6f781db87b3.zip
Merge pull request #26 from MakotoHirano/master
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);
}