報錯信息:
Caused by: org.apache.ibatis.reflection.ReflectionException: There is no setter for property named 'xxxxx' in 'class java.lang.String'
原因其實有很多種,比如</resultMap>裏面定義字段時,字段後面跟了空格等: "xxx "
我這裏出現這個bug的原因是,我在這個 </collection>中引用的子查詢裏定義了個參數類型:parameterType="String",去掉就好了。原因是我傳遞的是多參數,這裏不能用用一個參數類型去約束,可能mybatis內部認爲你的兩個參數類型可能是不一致的。