objectbox / objectbox/objectbox-java
add method 'contains' to QueryBuilder for array properties (like BooleanArray,IntArray,LongArray in Kotlin)
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 4.6k
- Forks
- 311
- PR merge metrics
- No merged PRs in 30d
Description
Is there an existing issue?
- I have searched existing issues
Use case
❗ It is very useful when implementing paged queries.
class Entity {
var ids: LongArray? = null
}
fun QueryBuilder<Entity>.filter(id: Long) {
contains(Entity_.ids, id)
}
Proposed solution
public QueryBuilder<T> contains(Property<T> property, bool value)
public QueryBuilder<T> contains(Property<T> property, int value)
public QueryBuilder<T> contains(Property<T> property, long value)
OR
public PropertyQueryCondition<ENTITY> contains(bool value)
public PropertyQueryCondition<ENTITY> contains(int value)
public PropertyQueryCondition<ENTITY> contains(long value)
Alternatives
TODO Describe any alternative solutions or features you've considered.
Additional context
TODO Add any other context (e.g. platform or language) about the feature request here.
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 with the QueryBuilder and PropertyQueryCondition entry points mentioned in the issue, then inspect existing condition methods and their tests for scalar properties. The work is done when contains supports BooleanArray, IntArray, and LongArray properties with the proposed value types and coverage verifies the query behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, kotlin
- Domain
- database
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100