当前使用版本(必填,否则不予处理)
3.5.1
该问题是如何引起的?(确定最新版也有问题再提!!!)
在mapper接口中自定义方法,在对应的xml文件中书写sql文件,参数是UpdateWrapper 想通过set方法自动设置要更新的列的值
重现步骤(如果有就写完整)
1.实体类
Notice notice = new Notice();
notice.setId(4L);
notice.setTitle("测试测试");
notice.setContent("测试测试");
2.构造wrapper
UpdateWrapper<Notice> noticeUpdateWrapper = new UpdateWrapper<>();
noticeUpdateWrapper
.setEntity(notice)
.set("title", notice.getTitle())
.set("content", notice.getContent())
.eq("id", notice.getId());
noticeMapper.updateNotice(noticeUpdateWrapper);
3.NoticeMapper中的方法
void updateNotice(@Param(Constants.WRAPPER) UpdateWrapper<Notice> updateWrapper);
报错信息
### SQL: update notice WHERE (id = ?)
发现没有set语句