objectbox / objectbox/objectbox-java
Add query filter that tests for empty ToMany
未关闭
还没有人认领这个 Issue。
enhancement
- 主要语言
- Java
- 星标
- 4.6k
- 派生
- 311
- PR 合并指标
- 30 天内没有已合并 PR
描述
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>
}
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先定位 QueryBuilder API 及其现有的 filter() 处理,然后检查 ToMany 关系在查询中的表示方式。当 empty(SomeEntity_.otherEntities) 风格的查询返回没有相关 OtherEntity 记录的实体,并且有适当的查询测试覆盖时,工作即告完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- java, kotlin
- 领域
- databases
- Issue 类型
- 功能
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 25/100