objectbox-java
objectbox-java copied to clipboard
Add query filter that tests for empty ToMany
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>
}
Looking for this in the new Query API. Is there any alternatives that exist that would cause a live query to adapt?