现象:

mybatis mapper.xml 的sql里如果直接使用了想要传入的变量,比如:

<select id="selectXx" resultType="int" statementType="STATEMENT">
    SELECT COUNT(*)
    FROM B_PERSON
    WHERE
        ${columnName} != ''
</select>


会出现 There is no getter for property named '*' in 'class java.lang.String错误

原因及解决方案:

参见http://blog.csdn.net/qing_gee/article/details/47122227

另外,想到是因为找不到参数,所以尝试了下,在mapper接口方法里加上@Param(value = "该字段名")参数。结果发现这种方法也是可行的

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-11
  • 2022-02-04
猜你喜欢
  • 2022-12-23
  • 2021-04-07
  • 2022-12-23
  • 2021-07-04
  • 2021-08-15
  • 2022-12-23
相关资源
相似解决方案