objectbox / objectbox/objectbox-java

add method 'contains' to QueryBuilder for array properties (like BooleanArray,IntArray,LongArray in Kotlin)

未关闭
#1,211 1 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

enhancement
主要语言
Java
星标
4.6k
派生
311
PR 合并指标
30 天内没有已合并 PR

描述

Is there an existing issue?
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.

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 issue 中提到的 QueryBuilder 和 PropertyQueryCondition 入口点开始,然后检查现有的条件方法及其针对标量属性的测试。当 contains 支持使用所提议值类型的 BooleanArray、IntArray 和 LongArray 属性,并且覆盖率验证查询行为时,工作即完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
java, kotlin
领域
database
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。