mybatis collection中传递多参数时 报错:ReflectionException:There is no setter for property named xxxxx

报错信息:

mybatis collection中传递多参数时 报错:ReflectionException:There is no setter for property named xxxxx_第1张图片

Caused by: org.apache.ibatis.reflection.ReflectionException: There is no setter for property named 'xxxxx' in 'class java.lang.String'

原因其实有很多种,比如里面定义字段时,字段后面跟了空格等: "xxx  "

我这里出现这个bug的原因是,我在这个 中引用的子查询里定义了个参数类型:parameterType="String",去掉就好了。原因是我传递的是多参数,这里不能用用一个参数类型去约束,可能mybatis内部认为你的两个参数类型可能是不一致的。

mybatis collection中传递多参数时 报错:ReflectionException:There is no setter for property named xxxxx_第2张图片

 

你可能感兴趣的:(Mysql)