【問題描述】
環境:springboot2.3.1+mybatis plus3.3.2
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: Could not set property 'id' of 'class com.mxx.homekeeper.usermanage.entity.HkUserInfo' with value '1277617954032193538' Cause: java.lang.IllegalArgumentException: argument type mismatch
【解決方案】
在實體類的主鍵id上增加一個注解 @TableId(type = IdType.AUTO)
其他type類型介紹
AUTO : AUTO(0, “數據庫ID自增”),
INPUT : INPUT(1, “用戶輸入ID”),
ID_WORKER : ID_WORKER(2, “全局唯一ID”),
UUID : UUID(3, “全局唯一ID”),
NONE : NONE(4, “該類型為未設置主鍵類型”),
ID_WORKER_STR : ID_WORKER_STR(5, “字符串全局唯一ID”);