Skip to content

feat(metadata): 提供列编解码及查询映射只读配置 - #142

Merged
zhou-hao merged 2 commits into
4.2from
codex/codec-configuration
Nov 25, 2026
Merged

zhou-hao merged 2 commits into
4.2from
codex/codec-configuration

Conversation

@zhou-hao

@zhou-hao zhou-hao commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

映射描述和查询贡献者需要读取实际生效的配置。标准 codec 不能被实体注解或默认值替代;追加查询映射时也不能覆盖已有 FROM/JOIN 绑定,或重复使用已有引用名。

提供日期、数字、布尔、枚举及 JSON codec 的只读配置 API。数字函数构造器不声明可重建目标类型;JSON 区分显式外部 mapper 与标准选项派生副本,调用方可以拒绝无法重建的行为,不需要反射或复制解析器默认值。

查询通过 getTableReferences() 返回 FROM、JOIN 目标/别名和显式绑定引用名的不可变快照,通过 getTableBindings() 读取不可变绑定。QueryTableBindings.merge(...) 保留已有映射并拒绝同名不同映射的冲突,供贡献者安全追加结构,不需要向下转型或读取 SQL 文本。既有 bindTables(...) 显式替换、null 清除、context 以及编解码行为保持不变。

验证:Java 21,mvn -q -o -Djava.awt.headless=true -pl hsweb-easy-orm-rdb -am '-Dtest=*Codec*Test,DefaultValueCodecResolverTest,QueryTableBindingsTest,BuildParameterQueryOperatorTest,DefaultQuerySqlBuilderTest,JoinFragmentBuilderTest,QueryTermsFragmentBuilderStrictModeTest,QueryTermsFragmentBuilderCoverageTest,QueryTermsFragmentBuilderTest' -Dsurefire.failIfNoSpecifiedTests=false -DfailIfNoTests=false test,22 类 / 84 项全部通过,零失败、错误或跳过;本地 mvn -q -o -Djava.awt.headless=true -DskipTests install 成功。覆盖只读快照/冲突拒绝、clone 和默认配置、JOIN、查询构造器、严格条件及既有 codec。

消费者:jetlinks-components #1707 将直接读取这些配置。API 不传输任意转换函数、Jackson 模块或共享 mapper 的完整状态。

@codecov-commenter

codecov-commenter commented Nov 18, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 86.66667% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.15%. Comparing base (68b2764) to head (8005001).
⚠️ Report is 67 commits behind head on 4.2.

Files with missing lines Patch % Lines
...ramework/ezorm/rdb/operator/dml/QueryOperator.java 0.00% 2 Missing ⚠️
...hswebframework/ezorm/rdb/codec/JsonValueCodec.java 80.00% 0 Missing and 1 partial ⚠️
...orm/rdb/operator/dml/query/QueryTableBindings.java 88.88% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##                4.2     #142       +/-   ##
=============================================
+ Coverage     64.92%   81.15%   +16.23%     
- Complexity     2341     3740     +1399     
=============================================
  Files           343      384       +41     
  Lines          9375    11449     +2074     
  Branches        940     1410      +470     
=============================================
+ Hits           6087     9292     +3205     
+ Misses         2810     1515     -1295     
- Partials        478      642      +164     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@zhou-hao zhou-hao changed the title feat(codec): 提供标准编解码器只读配置 feat(metadata): 提供列编解码及查询映射只读配置 Nov 18, 2026
@zhou-hao
zhou-hao merged commit 728b5df into 4.2 Nov 25, 2026
1 check passed
@zhou-hao
zhou-hao deleted the codex/codec-configuration branch November 25, 2026 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants