Repository navigation
fix(查询与CRUD): 支持操作级表绑定并完善缓存和保存契约 - #138
Merged
Merged
Conversation
统一同步与响应式无更新列保存的存在性语义,保留原条件与普通更新保护。补充局部 JSON 十进制精度选项并统一 H2 枚举工厂。
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## 4.2 #138 +/- ##
=============================================
+ Coverage 64.92% 80.70% +15.77%
- Complexity 2341 3695 +1354
=============================================
Files 343 382 +39
Lines 9375 11443 +2068
Branches 940 1414 +474
=============================================
+ Hits 6087 9235 +3148
+ Misses 2810 1554 -1256
- Partials 478 654 +176 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
zhou-hao
commented
Nov 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
完整实体可能包含当前订阅者的权限与装配结果,空更新列保存也需要保留主键及原 WHERE 语义。本 PR 补足这两个通用契约,并允许调用方为一次查询绑定表映射,以支持独立元数据快照而不替换共享 schema。
实现
ReactiveRepository.isResultCacheable():普通仓库默认 true;默认仓库委托结果 transformer 的同名声明。转换器默认 false,仅当结果不依赖订阅者上下文且依赖数据更新由既有失效机制覆盖时显式返回 true;权限装饰器仍可独立否决。上层据此决定是否共享完整结果,不识别业务类型,不引入租户或用户缓存 key。QueryOperator.bindTables(QueryTableBindings):服务端显式绑定本次查询的 FROM/JOIN 表映射,JOIN 沿用.join(),条件、投影、排序共用映射。同步/异步 SQL 构建优先显式绑定,没有绑定时沿用 schema 查找;内存绑定直接解析,命中后使用Mono.fromSupplier延迟构建 SQL,未命中直接调用异步查表,不为本地值增加 just/flatMap 中转。绑定保留在查询及其 clone 内,context 恢复普通赋值,不解析或安装执行对象,也不增删 JOIN。绑定本身不授予权限、不执行 DDL。JsonCodec.useBigDecimalForFloats是默认关闭的列级精度选项,与 includeNulls 独立组合,普通 JSON 默认 Double 行为保持不变。README 和公共接口/查询边界注释已同步。未新增后台任务或全局元数据缓存。
验证
mvn ... install构建成功,git diff --check通过。调用新 API 或注解选项的下游需先取得本 PR 对应的
4.2.3-SNAPSHOT。已合并的 #137 不包含这些增量;本次没有合并或发布上游。无有效更新列保存修复原失败路径,UPDATE-then-INSERT 的既有并发保证保持原样。