Repository navigation
feat(数值列): 统一方言映射并支持无约束精度 - #143
Merged
Merged
Conversation
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.2 #143 +/- ##
=============================================
+ Coverage 64.92% 81.18% +16.25%
- Complexity 2341 3727 +1386
=============================================
Files 343 385 +42
Lines 9375 11431 +2056
Branches 940 1411 +471
=============================================
+ Hits 6087 9280 +3193
+ Misses 2810 1511 -1299
- Partials 478 640 +162 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
显式要求无固定精度的数值列时,调用方原先需要自行拼接
numericDDL;注解解析和动态列还各自构造数值类型,导致方言映射及默认精度不一致。本次通过列元数据和@ColumnType的unconstrainedNumeric声明数值约束,标准 NUMERIC/DECIMAL/number 别名统一走方言注册的DataTypeBuilder,在最终构造时读取声明并补默认值,不修改列元数据、不使用 columnDefinition,也不增加专用方言 hook。PostgreSQL 构造裸
numeric/decimal表达无约束,其他已注册数值映射明确拒绝;反读保留声明,建表变更支持放宽且不自动收窄。未声明精度时统一采用各方言原有类型构造默认值:PostgreSQL32、Oracle38;H2 的解析与动态路径统一输出 decimal。显式 precision/scale 不变,scale=0 和 PostgreSQL 负标度均按实际声明保留。显式自定义类型构造器仍优先,由其负责解释列声明;precision=0 表示推断,不能代替显式无约束。验证:32 项 ORM 回归全部通过,覆盖六种方言的动态/类型解析路径、完整 JPA 解析、固定零标度、负标度、自定义构造器优先级及元数据不变性;包含真实 PostgreSQL 16 建表、固定精度放宽、精确写入与 min/sum/avg、反读及重复应用。JetLinks 调用方的 327 项定向回归和 9 项隔离 PostgreSQL/TimescaleDB 测试通过,IDEA 8 个受影响主文件定向编译通过。
原 IDEA 配置启动 IoT/规则服务后,内置浏览器确认树莓派产生 12:43:40 的新数值结果 2.05,历史读取正常,运行诊断显示就绪且副本为 1;状态输出继续更新至 12:44。未修改存储结构、证据开关或保留期,未清理或回填本地数据。其他数据库只验证类型映射及 JPA 路径,未宣称实机兼容验证。
配套接入:jetlinks-components #1760。需先合并并发布此 ORM 快照,再构建调用方;本地已安装对应
4.2.4-SNAPSHOT,不据此宣称远端制品已发布。