mirror of
https://github.com/google/nomulus
synced 2026-09-16 13:04:19 +00:00
Add a method to set a "not in" WHERE clause in CriteriaQueryBuilder (#1225)
<!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/google/nomulus/1225) <!-- Reviewable:end -->
This commit is contained in:
@@ -62,6 +62,13 @@ public class CriteriaQueryBuilder<T> {
|
||||
return where(root.get(fieldName).in(values));
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a WHERE clause to the query specifying that a value must not be in the given collection.
|
||||
*/
|
||||
public CriteriaQueryBuilder<T> whereFieldIsNotIn(String fieldName, Collection<?> values) {
|
||||
return where(root.get(fieldName).in(values).not());
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a WHERE clause to the query specifying that a collection field must contain a particular
|
||||
* value.
|
||||
|
||||
Reference in New Issue
Block a user