报错:
exception [Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: Could not set property 'id' of 'class top.weimumu.loginapi.entity.CircleLikeEntity' with value '1232274629041627138' Cause: java.lang.IllegalArgumentException: argument type mismatch] with root cause
java.lang.IllegalArgumentException: argument type mismatch
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_151]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_151]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_151]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_151]
背景分析:
我是用mybatis-plus直接insert的,但是insert过程中报错,然后报的是id有问题,后来我排查了一下数据库是int类型,实体我是
Integer类型
解决办法:将实体的 Integer 改成int类型即可
你是技术宅么?那就加入我们吧~本博主不一定长期在线,可以进群大家一起解决问题~
欢迎加入 CSDN技术交流群2:(点击即可加群)QQ群:456543087
CSDN技术交流群(已满员):(点击即可加群)QQ群:681223095。
商务合作@群主,谢谢!