记一次使用mybatisplus新增功能出现Could not set property ‘id‘ of class XXXXXXXX
记一次Could not set property ‘id’ of 'class com.xxxx.xxx.xxxx.entity.xxxxx’的错误我使用mybatisplus在表映射到的实体类上注明@TableName("XXXX),然后就直接开始写新增功能,发现报这个错误,我的数据库表的id设置的是自动增长,我从页面传输的对象没有包括id,折腾我大半天,我想,应该是mybatis不知道实体类映射表的哪一个字段才是主键,于是乎我在实体类的id字段上加上 @TableId(value = "id"