objectbox-java icon indicating copy to clipboard operation
objectbox-java copied to clipboard

Add query filter that tests for empty ToMany

Open aahlenst opened this issue 6 years ago • 1 comments

It would be nice if QueryBuilder would allow to test for emptiness without having to resort to using filter(). This would be especially useful with many-to-many relations if one could write something like this:

boxFor(SomeEntity::class)
    .query()
    .empty(SomeEntity_.otherEntities)
    .build()
    .find()

This would return all instances of SomeEntity that do not have any related OtherEntity if SomeEntity is defined like this:

class SomeEntity {
    lateinit var otherEntities: ToMany<OtherEntity>
}

aahlenst avatar Mar 21 '19 12:03 aahlenst

Looking for this in the new Query API. Is there any alternatives that exist that would cause a live query to adapt?

Queatz avatar Nov 22 '20 22:11 Queatz