mybatisplus进行saveOrUpdate的时候报错:can not execute. because can not find column for id from entity!
在使用mybatisplus进行saveOrUpdate的时候报错了,提示:com.baomidou.mybatisplus.core.exceptions.MybatisPlusException: error: can not execute. because can not find column for id from entity!
发布于:3年前 (2022-10-18) IP属地:四川省
1 个回答

在使用mybatisplus进行saveOrUpdate的时候,默认是使用id进行保存或者更新的,因此需要在实体的主键字段里面添加注解@TableId。例如:
@TableId(value = "id", type = IdType.AUTO)
private long id;
发布于:3年前 (2022-10-18) IP属地:四川省
我来回答
您需要 登录 后回答此问题!