mybatis plus 自带的删除方法删除提示There is no getter for property named 'id' in 'class java.lang.String' 主键和getset已有
removeById 可以 但是 removeByIds就不行
Caused by: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'id' in 'class java.lang.String'
@Data
@TableName("******")
public class ***Entity implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableId(value = "id",type=IdType.INPUT)
private String id;
这个问题是mybatisplus版本导致的 没搞懂为什么在3.0版本中,传个id的集合就行,而在3.4中却要传实体类集合,好像int类型的id集合也行
id没有get方法
自带的删除是按ID去删除的,你的实体是不是没有一个String id;的字段,或者没有get、set方法
删除方法 看一下
是不是有有参构造,没有无参构造