-
Notifications
You must be signed in to change notification settings - Fork 1.3k
fix(nl2sql): 修正实体类字段映射与数据库schema不一致 #2340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes entity class field mapping inconsistencies with the database schema in the nl2sql module. The BusinessKnowledge and SemanticModel entity classes had @TableField annotations that did not match the actual database table field names, causing errors when saving semantic model entities.
- Updated @TableField annotations in SemanticModel entity to match database schema
- Updated @TableField annotations in BusinessKnowledge entity to match database schema
- Maintained backward compatibility by modifying mapping fields rather than database schema
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
SemanticModel.java | Updated 7 @TableField annotations to match actual database column names |
BusinessKnowledge.java | Updated 2 @TableField annotations to match actual database column names |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
@zxuexingzhijie Could you please review this when you have time? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@zhangshenghang plta |
似乎 |
我看一下 |
已修复,所以为什么在nl2sql里有MyBatis Plus、MyBatis、JDBC三套写法啊 |
感觉确实是个比较抽象的问题
…---原始邮件---
发件人: ***@***.***>
发送时间: 2025年9月14日(周日) 上午9:17
收件人: ***@***.***>;
抄送: ***@***.******@***.***>;
主题: Re: [alibaba/spring-ai-alibaba] fix(nl2sql): 修正实体类字段映射与数据库schema不一致 (PR #2340)
mcallzbl left a comment (alibaba/spring-ai-alibaba#2340)
似乎SemanticModelMapper和BusinessKnowledgeMapper的SQL语句中也有这个问题,麻烦一起修复一下
已修复,所以为什么在nl2sql里有MyBatis Plus、MyBatis、JDBC三套写法啊
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
最初用的是JDBC,现在计划统一使用Mybatis |
Describe what this PR does / why we need it
修正nl2sql模块中实体类字段映射与数据库schema不一致的问题。
当前BusinessKnowledge和SemanticModel实体类的@TableField注解与实际数据库表字段名不匹配,导致保存语义模型实体时出错。
为保持向前兼容,以及确保现有sql查询正常运行,我选择修改映射字段。
Does this pull request fix one issue?
Fixes #2171
Describe how you did it
调整实体类的@TableField注解,使其与数据库schema完全匹配
Describe how to verify it
确认实体类@TableField注解与数据库schema.sql中的字段名一致
Special notes for reviews
这是一个字段映射的修复,没有改变业务逻辑,只是确保ORM映射的正确性。
修改后的字段映射与现有的硬编码SQL查询保持一致。