本文主要是介绍org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'leader,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
总结:mybatis传单个类型参数(String、Integer),在dao层方法中可以不用@param注解,前提是xml中不含有条件表达式(when,if..标签中没有引用到该参数)
1、错误信息:
![](/upload/202106/01/202106011222364653.png)
2、mapper.xml、dao方法:
![](/upload/202106/01/202106011222368754.png)
3、如果把mybatis的<if>标签去掉,就可以正常运行并接收传递的参数。如果想要使用条件表达式,那就要在dao层方法中加@Param("leader")
![](/upload/202106/01/202106011222370496.png)
4、加标签后运行正常!
这篇关于org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'leader的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!