Mybatis单个参数报错: There is no getter for property named
Posted OkidoGreen
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Mybatis单个参数报错: There is no getter for property named相关的知识,希望对你有一定的参考价值。
记录平时遇到过的问题,这个问题并不大,只是太久没写mybatis,忘了一些细节
总结:mybatis传单个String类型,可以不用@param注解,前提是xml中不含有条件表达式(when,if..标签中没有引用到该参数)
1.首先看一下方法,是一个简单的查询,参数只有一个String,印象中dao层方法只有一个string的时候,
可以直接在xml中使用#获取
2.但是报错了,提示该字段没有get方法
这里注意一下,错误的地方是用红框圈起来的哪里,也是就条件表达式,并非where语句
3.如果mybatis的if标签去掉,就可以正常运行,如果要使用条件表达式那就要在dao层加param标签
4.加标签后,运行正常
以上是关于Mybatis单个参数报错: There is no getter for property named的主要内容,如果未能解决你的问题,请参考以下文章
Mybatis单个参数的if判断(针对异常:There is no getter for property..)------mybatis的内置对象
Mybatis 传入List类型参数,报错:There is no getter for property named '__frch_item_0' in
Mybatis 报错 There is no getter for property named '***' in 'class java.lang.String'(示
解决Mybatis报错:org.apache.ibatis.reflection.ReflectionException: There is no getter for property named
org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'leader&
Mybatismybatis查询报错org.apache.ibatis.reflection.ReflectionException: There is no getter for propert(代