objectbox / objectbox/objectbox-java
Add query filter that tests for empty ToMany
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 4.6k
- Forks
- 311
- PR merge metrics
- No merged PRs in 30d
Description
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>
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the QueryBuilder API and its existing filter() handling, then review how ToMany relations are represented in queries. The work is complete when an empty(SomeEntity_.otherEntities)-style query returns entities with no related OtherEntity records and is covered by appropriate query tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, kotlin
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100