Skip to content

Commit daedc14

Browse files
authored
Merge pull request #18 from JWaldecker/patch-2
Add alias for whereNull / whereNotNull
2 parents 273b9b6 + 83180b4 commit daedc14

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/main/java/org/javawebstack/orm/query/Query.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,14 @@ public Query<T> notNull(Object left) {
164164
where.notNull(left);
165165
return this;
166166
}
167+
168+
public Query<T> whereNull(Object left) {
169+
return where.isNull(left);
170+
}
171+
172+
public Query<T> whereNotNull(Object left) {
173+
return where.notNull(left);
174+
}
167175

168176
public Query<T> lessThan(Object left, Object right) {
169177
where.lessThan(left, right);

src/main/java/org/javawebstack/orm/query/QueryGroup.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,14 @@ public QueryGroup<T> isNull(Object left) {
7979
public QueryGroup<T> notNull(Object left) {
8080
return where(left, "IS NOT NULL", null);
8181
}
82+
83+
public QueryGroup<T> whereNull(Object left) {
84+
return where(left, "IS NULL", null);
85+
}
86+
87+
public QueryGroup<T> whereNotNull(Object left) {
88+
return where(left, "IS NOT NULL", null);
89+
}
8290

8391
public QueryGroup<T> lessThan(Object left, Object right) {
8492
return where(left, "<", right);

0 commit comments

Comments
 (0)