]> source.dussan.org Git - iciql.git/commitdiff
fix query can automatically treat null clause depends on value 26/head
authorMakotoHirano <the.meat.of.zudoh.4kg@gmail.com>
Fri, 18 Nov 2016 08:35:45 +0000 (17:35 +0900)
committerMakotoHirano <the.meat.of.zudoh.4kg@gmail.com>
Fri, 18 Nov 2016 08:35:45 +0000 (17:35 +0900)
src/main/java/com/iciql/QueryCondition.java

index fce66afc8334571e33d6399a817fa6bd58c6d19a..56de97694d191bad66271b8b298185fc779d0807 100644 (file)
@@ -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);
     }