Mybatis关联子查询。
如果子查询入参为Integer时,会出现nested exception is org.apache.ibatis.reflection.ReflectionException: Error instantiating class java.lang.Integer with invalid types () or values (). Cause: java.lang.NoSuchMethodException: java.lang.Integer.()
异常。
处理方法:删除子查询的parameterType即可。因为关联子查询时,mybatis会调用Integer的无参构造方法。但是Integer没有无参构造方法。故返回此异常
Mybatis关联子查询。Integer反射异常处理
最新推荐文章于 2024-06-19 09:29:01 发布