现象:

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 = "该字段名")参数。结果发现这种方法也是可行的

mybatis 错误: There is no getter for property named '*' in 'class java.lang.String解决的更多相关文章

  1. Mybatis查询报错:There is no getter for property named '*' in 'class java.lang.String

    问题: 执行查询时报错:There is no getter for property named '*' in 'class java.lang.String 原因: 传过去的参数为识别.本例为 p ...

  2. 【MyBatis学习06】_parameter:解决There is no getter for property named in class java.lang.String

    我们知道在mybatis的映射中传参数,只能传入一个.通过#{参数名} 即可获取传入的值. Mapper接口文件: public int delete(int id) throws Exception ...

  3. _parameter:解决There is no getter for property named in class java.lang.String

    我们知道在mybatis的映射中传参数,只能传入一个.通过#{参数名} 即可获取传入的值. Mapper接口文件: public int delete(int id) throws Exception ...

  4. Mybatis 报错 There is no getter for property named '***' in 'class java.lang.String'

    在mapper.xml中 , 如果单参数是String类型 , 且在sql语句中对参数进行了判断 , 如下 when 中的判断 , 如果出现 if 判断也是一样的.都需要把判断中的参数用 _param ...

  5. mybatis There is no getter for property named '*' in 'class java.lang.String

    1.原因 server层     xxxx.get("1234") map <if test="aaa != null and aaa.id != null and ...

  6. mybatis 异常 There is no getter for property named 'bizId' in 'class java.lang.Long'

    mybatis 异常 There is no getter for property named 'bizId' in 'class java.lang.Long' 当使用mybatis进行传参的时候 ...

  7. Java 异常 Failed to convert property value of type 'java.lang.String' to required type 'java.util.Date'

    查询时发送给服务器的日期的字符串格式:yyyy-MM-dd HH:mm:ss 服务器接收到日期的字符串之后,向 MySQL 数据库发起查询时,因为没有指定日期时间格式,导致字符串数据不能正确地转换为日 ...

  8. spring mvc出现 Failed to convert property value of type 'java.lang.String' to required type 'java.util.Date' for property 'endtime'

    在使用spring mvc中,绑定页面传递时间字符串数据给Date类型是出错: Failed to convert property value of type [java.lang.String] ...

  9. 【spring mvc】后台API查询接口,get请求,后台Date字段接收前台String类型的时间,报错default message [Failed to convert property value of type 'java.lang.String' to required type 'java.util.Date' for property 'createDate';

    后台API查询接口,get请求,后台Date字段接收前台String类型的时间筛选条件 后台接口接收 使用的实体 而createDate字段在后台实体中是Date类型 报错信息: org.spring ...

随机推荐

  1. Hadoop平台的基本组成与生态系统

    Hadoop系统运行于一个由普通商用服务器组成的计算集群上,该服务器集群在提供大规模分布式数据存储资源的同时,也提供大规模的并行化计算资源. 在大数据处理软件系统上,随着Apache Hadoop系统 ...

  2. 在线教育工具—白板系统的迭代1——bug监控排查

    近一年都在做一款在线教育工具(以下统称为“白板”)的开发工作,期间遇到N多的问题与坑,遂在此记录,并及时更新. 第一篇:关于资源访问填坑 因为是在线授课,所以使用我们白板的人员地域范围较广,基本上西到 ...

  3. 配置AD RMS的一点心得

    基本上是按照下面的连接配置的,微软写的很好 AD RMS Step-by-Step Guide http://technet.microsoft.com/en-us/library/cc753531( ...

  4. 一定要用Windows自带的记事本编辑 applicationHost.config

    访问IIS时,发生了一个 HipIISEngineStub.dll不能读取的问题.(Windows Event可以确认). 很容易在网上找到了对策, http://chrisfleischhacker ...

  5. bzoj1854: [Scoi2010]游戏 贪心

    lxhgww最近迷上了一款游戏,在游戏里,他拥有很多的装备,每种装备都有2个属性,这些属性的值用[1,10000]之间的数表示.当他使用某种装备时,他只能使用该装备的某一个属性.并且每种装备最多只能使 ...

  6. 《剑指offer》习题解答(C/C++)

    1.二维数组中的查找 /* 题目:在一个二维数组中,没一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序. 请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数 ...

  7. qt Cannot connect creator comm socket /tmp/qt_temp.S26613/stub-socket: No such

    Tool->Options->Environment->General 将terminal改为 xterm -e

  8. JSP session过期时间(小记)

    以下情况,Session结束生命周期,Servlet容器将Session所占资源释放:1.客户端关闭浏览器2.Session过期3.服务器端调用了HttpSession的invalidate()方法. ...

  9. Qt Creator 模块QtSql

    在新建Qt Gui Application时,没有弹出模块选择页, 可以手动在pro文件中增加. 比如要选中QtSql模块,(目前我没有找到哪里可以修改要选中的模块), 我是手动在pro文件中增加了一 ...

  10. [置顶] Unity2d引入新功能SpriteAtlas,Sprite新的图集方式

    孙广东  2017.8.3 http://blog.csdn.NET/u010019717 在Unity 2017.1.0f3中引入了 SpriteAtlas 官方文档:  https://docs. ...