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

使用mysql自动生成主键策略时,dbm使用GeneratedKeyHolder把生成的id设置回实体时,会抛错 #41

Open
wayshall opened this issue Dec 14, 2021 · 0 comments
Assignees
Labels
Milestone

Comments

@wayshall
Copy link
Owner

升级spring版本后,使用mysql自动生成主键策略时,dbm使用GeneratedKeyHolder把生成的id设置回实体时,会抛错。
提示不能设置id为null。

原因:实际上是实用GeneratedKeyHolder获取到的值类型为biginteger,而实体类型为Long,导致设置失败。

@wayshall wayshall self-assigned this Dec 14, 2021
@wayshall wayshall added the bug label Dec 14, 2021
@wayshall wayshall added this to the 5.0.0 milestone Dec 14, 2021
wayshall added a commit that referenced this issue Dec 14, 2021
使用mysql自动生成主键策略时,dbm使用GeneratedKeyHolder把生成的id设置回实体时,会抛错

fix #41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant