Skip to content

Conversation

mcallzbl
Copy link
Contributor

@mcallzbl mcallzbl commented Sep 6, 2025

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查询保持一致。

@CLAassistant
Copy link

CLAassistant commented Sep 6, 2025

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added the area/nl2sql SAA nl2sql module label Sep 6, 2025
Copy link
Contributor

@Copilot Copilot AI left a 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.

@mcallzbl
Copy link
Contributor Author

@zxuexingzhijie Could you please review this when you have time?

Copy link
Collaborator

@zxuexingzhijie zxuexingzhijie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@zxuexingzhijie
Copy link
Collaborator

@zhangshenghang plta

@VLSMB
Copy link
Collaborator

VLSMB commented Sep 13, 2025

似乎SemanticModelMapperBusinessKnowledgeMapper的SQL语句中也有这个问题,麻烦一起修复一下

@mcallzbl
Copy link
Contributor Author

似乎SemanticModelMapperBusinessKnowledgeMapper的SQL语句中也有这个问题,麻烦一起修复一下

我看一下

@github-actions github-actions bot added area/graph SAA Grpah module area/jmanus SAA Jmanus module area/docs SAA Docs module area/core SAA Core module area/studio SAA Studio module area/deepresearch SAA Deepresearch module area/community SAA community module area/memory SAA Community chat memory module labels Sep 14, 2025
@github-actions github-actions bot removed area/graph SAA Grpah module area/jmanus SAA Jmanus module area/docs SAA Docs module area/core SAA Core module area/studio SAA Studio module area/deepresearch SAA Deepresearch module area/community SAA community module area/memory SAA Community chat memory module labels Sep 14, 2025
@mcallzbl
Copy link
Contributor Author

mcallzbl commented Sep 14, 2025

似乎SemanticModelMapperBusinessKnowledgeMapper的SQL语句中也有这个问题,麻烦一起修复一下

已修复,所以为什么在nl2sql里有MyBatis Plus、MyBatis、JDBC三套写法啊

@zxuexingzhijie
Copy link
Collaborator

zxuexingzhijie commented Sep 14, 2025 via email

@VLSMB
Copy link
Collaborator

VLSMB commented Sep 14, 2025

似乎SemanticModelMapperBusinessKnowledgeMapper的SQL语句中也有这个问题,麻烦一起修复一下

已修复,所以为什么在nl2sql里有MyBatis Plus、MyBatis、JDBC三套写法啊

最初用的是JDBC,现在计划统一使用Mybatis

@VLSMB VLSMB merged commit 9f0b1c0 into alibaba:main Sep 14, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/nl2sql SAA nl2sql module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] nl2sql semantic_model 实体类字段更新但 schema.sql 建表语句未同步
4 participants