From c01feb79be8ca444a704dc20b0859295289fd524 Mon Sep 17 00:00:00 2001 From: MakotoHirano Date: Fri, 18 Nov 2016 17:35:45 +0900 Subject: fix query can automatically treat null clause depends on value --- src/main/java/com/iciql/QueryCondition.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 { } public QueryWhere is(A y) { - query.addConditionToken(new Condition(x, y, CompareType.EQUAL)); + if (y == null) { + query.addConditionToken(new Condition(x, CompareType.IS_NULL)); + } else { + query.addConditionToken(new Condition(x, y, CompareType.EQUAL)); + } return new QueryWhere(query); } -- cgit v1.2.3