MybatisPlusException: error: can not execute. because can not find column for id from entity

问题

使用mybatis-plus时 ,使用了方法saveOrUpdate,出现问题

com.baomidou.mybatisplus.core.exceptions.MybatisPlusException: error: can not execute. because can not find column for id from entity!
MybatisPlusException: error: can not execute. because can not find column for id from entity

解决

可以看到:

can not find column for id from entity!
所以,需要对实体类 的主键 添加注解 @TableId
MybatisPlusException: error: can not execute. because can not find column for id from entity
此时再次运行,一切ok。

上一篇:Data truncation: Data too long for column ‘content‘ at row 1(存大数据进数据库时报错)


下一篇:mybatis-注解实现复杂查询-多表查询-(2)