Skip to content
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

BeanUtils.copyProperties()属性拷贝可能会导致Mysql表主键重复问题 #69

Open
it-lzq025 opened this issue Mar 22, 2024 · 2 comments

Comments

@it-lzq025
Copy link

流程初始化、流程提交过程多个方法有用到BeanUtils.copyProperties(),比如 FlowInstancePO 属性拷贝至 InstanceDataPO过程中,FlowInstancePO中主键 ID可能在 InstanceDataPO实体表中已存在,直接拷贝后再调用 InstanceDataPO 的insert方法会报主键重复错误

@it-lzq025
Copy link
Author

turbo样列
本地Demo中节点驳回后再次提交过程会出现主键重复错误

@liangchenhui
Copy link
Collaborator

主要原因是项目中的insert是依赖mybatis的主键自增,但是部分mybatis版本不支持忽略已有id自增,可以修改一下代码主动设置为null,或者调整mybatis的版本

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

No branches or pull requests

2 participants