Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException:
nested exception is org.apache.ibatis.reflection.ReflectionException:
Could not set property 'userId' of 'class com.xdx.entitys.pojo.SyUser' with value '1266635804901814274'
Cause: java.lang.IllegalArgumentException: argument type mismatch] with root cause
這個異常就是一個參數類型不匹配的問題,比如你的數據庫是int,但是你插入的是String,所以按照這個思路去解決就好了。
但是我怎麼修改類型都是不對,我使用到了MyBatisPlus 裏面的 @TableId 註解,一般我加上都沒什麼問題。但是我這次主鍵使用的是自增長,那麼應該這樣寫。
/**
* 用戶id
*/
@TableId(value = "user_id",type = IdType.AUTO)
private Integer userId;