objectbox-java
objectbox-java copied to clipboard
Queries: Support "notIn" with string arrays like "in" does
On queries, you can use string array "overloads" for in in the following ways:
QueryBuilder<T> in(Property<T> property, String[] values)
QueryBuilder<T> in(Property<T> property, String[] values, StringOrder order)
The same "overloads" are not supported for notIn though, which only supports int and long arrays

Edit: additional suggestions via #1129:
- Implement
doesNotContain,doesNotEndWith,doesNotStartWithintoPropertyor- Create
QueryCondition.not()that would allow to negate any given QueryConditionExample use case for the latter :
Character_.lastName.equal("lannister", QueryBuilder.StringOrder.CASE_INSENSITIVE) .and(Character_.firstName.startsWith("ty", QueryBuilder.StringOrder.CASE_INSENSITIVE)) // "Tywin", "Tyrion", "Tytos" Character_.lastName.equal("lannister", QueryBuilder.StringOrder.CASE_INSENSITIVE) .and(Character_.firstName.startsWith("ty", QueryBuilder.StringOrder.CASE_INSENSITIVE).not()) // "Cersei", "Jaime", "Lancel"
Thanks! Yes, this is currently not supported. Thumbs up the first comment to help us track interest!