org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: Could not set property ‘id’ of ‘class com.itheima.domian.User’ with value ‘1481260909543333890’ Cause: java.lang.IllegalArgumentException: argument type mismatch
问题描述:
在使用mybatisPlus入门案例的时候 user实体类的ID 我用的是Integer id
这是不行的, 得需要用包装类型Long来接收
他的id可以生成策略控制(@TableId注解)
-
名称:@TableId
-
类型:属性注解
-
位置:模型类中用于表示主键的属性定义上方
-
作用:设置当前类中主键属性的生成策略
-
相关属性
type:设置主键属性的生成策略,值参照IdType枚举值