现象:

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. 在 R 中使用 Python 字符串函数

    sprintf( )函数很强大,但并非适用于所有应用场景.例如,如果一些部分在模板中多次出现,那么就需要多次写一样的参数.这通常会使得代码冗长而且难以修改:sprintf("%s, %d y ...

  2. VC6_预编译头

    1.去掉 使用预编译头"stdafx.h" VC6 --> Project --> Settings.. --> C/C++选项卡 --> "Ca ...

  3. poj3734矩阵快速幂

    挑战上面的题目,感觉脑洞很大 分别找红蓝个数全为偶,全为奇,一奇一偶的个数ai,bi,ci 转移矩阵是| 2 1 0 |,是一个对称矩阵(会不会有什么联系.) | 2 2 2 | | 0 1 2 | ...

  4. 2-14-1 MySQL基础语句,查询语句

    一. SQL概述 结构化查询语言(Structured Query Language)简称SQL 1. 它是一种特殊目的的编程语言 2. 它还是一种数据库查询和程序设计语言 (用于存取数据以及查询.更 ...

  5. 将C语言的CRC32 代码转成JAVA的CRC32 代码

    public class CustomerCRC32 { private static long[] crc32Table = new long[256]; static { long crcValu ...

  6. [svc]线上Iptables重启报错

    线上iptables重启了下发现报错,排查了下 [root@xxxx ~]# /etc/init.d/iptables restart iptables: Setting chains to poli ...

  7. MySQL_explain关键字分析查询语句

    版权声明:本文为博主原创文章,转载请注明出处. 通过对查询语句的分析,可以了解查询语句的执行情况.MySQL中,可以使用EXPLAIN语句和DESCRIBE语句来分析查询语句. EXPLAIN语句的基 ...

  8. OMAP4之DSP核(Tesla)软件开发学习(二)Linux内核驱动支持OMAP4 DSP核

    注:必须是Linux/arm 3.0以上内核才支持RPMSG,在此使用的是.config - Linux/arm 3.0.31 Kernel Configuration.(soure code fro ...

  9. .net 面试题总结

    1. DataSet和DataReader的区别? DataReader:和数据库处于一直连接状态.只读只能向前读取,一次只能读取一行信息.DataReader每次只在内存中加载一条数据,内存占用少, ...

  10. GPU编程自学7 —— 常量内存与事件

    深度学习的兴起,使得多线程以及GPU编程逐渐成为算法工程师无法规避的问题.这里主要记录自己的GPU自学历程. 目录 <GPU编程自学1 -- 引言> <GPU编程自学2 -- CUD ...