报错代码:
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: Could not set property 'id' of 'class com.unicom.product_library.pojo.entity.ProductAdvantage' with value '1661288085312974850' Cause: java.lang.IllegalArgumentException: argument type mismatch
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: Could not set property 'id' of 'class com.unicom.product_library.pojo.entity.ProductAdvantage' with value '1661288085312974850' Cause: java.lang.IllegalArgumentException: argument type mismatch
报错原因:
1.mybatis-plus在你未定义主键值的时候会通过算法给其生成一个很长的随机数,上面报错就是因为插入id过长报错
解决办法:
给实体类加上主键注解
/**
* 主键id
*/
@TableId(value = "id", type = IdType.AUTO)
private Integer id;