There is no getter for property named ‘questionType’ in 'class com.entity.order.QuestionType
今天编程遇到了问题,在调mybatis的mapper时,报这个错。
我用的系统时spring boot+mybatis,在调mapper.java中方法查询数据时,传的是对象参数,用@Param定义了参数,如下:
List<QuestionType> queryQuestionType(@Param("questionType") QuestionType questionType);
结果就一直报没有getter属性,试了用_parameter来代替questionType可以成功,但还是想弄明白为什么用questionType不行,最后发现在给@Param引包时引错了,要引
import org.apache.ibatis.annotations.Param;
这个包。最后试了下成功了。