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

关于 this.baseMapper.deleteByPrimaryKey(dto.getResId())的疑问咨询 #93

Closed
chinaluopiao opened this issue Dec 11, 2023 · 2 comments

Comments

@chinaluopiao
Copy link

在使用过程中,我对实体类使用了jpa标记了主键id,但是生成的sql语句确是
DELETE FROM serializable WHERE

详细的相关类片段代码如下:
image
mapper情况如下:
image

经过查阅相关的源码发现,是先找方法类型,再找泛型类型,相关源码截图如下:
image

不知道是我的使用方式有误,还是一个bug,根据方法名字和使用惯例,应该是联想到根据主键id删除。盼复,谢谢!

@chinaluopiao
Copy link
Author

补充一下生成的sql语句如下:
image

@chinaluopiao
Copy link
Author

另外我同时调用了
1.findById
2.deleteById

其中1能够正常的执行sql,而2却不行,详情如图:
image

image

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

1 participant