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

public interface TestMapper{
    List<Base> findAllBase(String search);
}
<select id="findAllBase" resultType="*.Base" parameterType="String">
        select id,name from t_base
        where 1=1
        <if test="search != null and search != ''">
            AND name LIKE CONCAT('%',#{search },'%')
        </if>
        order by id
</select>

解决方法:
1、在mapper接口增加参数设置,如下:

public interface TestMapper{
    List<Base> findAllBase(@Param(value="search") String search);
}

2、将具体报错的变量名更换为_parameter,如下:

<select id="findAllBase" resultType="*.Base" parameterType="String">
        select id,name from t_base
        where 1=1
        <if test="_parameter!= null and _parameter!= ''">
            AND name LIKE CONCAT('%',#{search },'%')
        </if>
        order by id
</select>

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'

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

  2. mybatis 错误: There is no getter for property named '*' in 'class java.lang.String解决

    现象: mybatis mapper.xml 的sql里如果直接使用了想要传入的变量,比如: <select id="selectXx" resultType="i ...

  3. 【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 ...

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

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

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

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

  6. 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 ...

  7. Mybatis报错: There is no getter for property named xxx

    在mapper文件中函数的形参上加上注解. 例如: 出现了如下错误:核心错误提示就是There is no getter for property named xxx     ### Error qu ...

  8. mybatis报错,There is no getter for property named 'templateName' in 'class

    There is no getter for property named 'templateName' in 'class 主要原因是因为mapper.xml 的语句有错误,导致在bean里找不到相 ...

  9. MyBatis if test 传入一个数字进行比较报错 There is no getter for property named 'userState' in 'class java.lang.Integer'

    在写MyBatis映射文件中,我要传入一个 int 类型的参数,在映射文件中用 'test' 中进行比较,我花了很长时间百度,发现都是不靠谱的方法,有把数字在比较时转成字符串用 equals 比较的. ...

随机推荐

  1. 大数据 Big Data howto

    The Fourth Paradigm: Data-Intensive Scientific Discovery http://research.microsoft.com/en-us/collabo ...

  2. winscp介绍与使用

    winscp介绍 WinSCP 是一个 Windows 环境下使用的 SSH 的开源图形化 SFTP 客户端.同时支持 SCP 协议.它的主要功能是在本地与远程计算机间安全地复制文件,并且可以直接编辑 ...

  3. 既然有了HBase,为什么还需要Kudu呢?

    不多说,直接上干货! 那既然有了HBase,为什么还需要Kudu呢? 简单的说,就是嫌弃HBase在OLAP(联机分析处理)场合,SQL/MR类的批量检索场景中,性能不够好.通常这种海量数据OLAP场 ...

  4. 换晶振导致stm32串口数据飞码的解决办法

    一般来说,stm32f107都是用标配的晶振,比如8MHz. 但是,如果用别的晶振,比如13.56M的晶振,那串口接收还正常吗? 根据试验结果,很可能会飞码.比如说用串口助手发送的是0x35,但是在串 ...

  5. 新浪微博OAuth2授权错误 error:redirect_uri_mismatch

    最近想在app进行新浪微博认证,结果发现总是报error:redirect_uri_mismatch错误. 网上搜了解决方法. 进入 http://open.weibo.com/apps/app_ke ...

  6. MySQL连接服务端的几种方式

    一.MySQL 连接本地数据库,用户名为“root”,密码“123456”: D:\>mysql -h localhost -u root -p123456 注意:“-p”和“123456” 之 ...

  7. php socket简单使用

    php的socket编程算是比较难以理解的东西吧,不过,我们只要理解socket几个函数之间的关系,以及它们所扮演的角色,那么理解起来应该不是很难了,在笔者看来,socket编程,其实就是建立一个网络 ...

  8. Arm启动流程解析

    谈到arm的启动流程不得不说的是bootloader,但是我这篇文章主要来谈谈arm启动流程的,所以bootloader只是跟大家简介一下就ok.这篇文章我会谈到以下内容: 1.bootloader简 ...

  9. Struts2_HelloWorld_6

    为 eclipse 在编写 xml配置文件时提供提示,需要加上dtd或xls的标签定义文件的路径,具体操作: 1.Window——Preferences——XML Catalog 2.添加 dtd 文 ...

  10. Python基础学习之序列(1)

    序列 序列类型有着相同的访问模式:它的每一个元素可以通过指定一个偏移量的方式得到.而多个元素可以通过切片操作的方式一次得到,下标偏移量是从0开始到总元素-1结束,之所以要减1是因为我们是从0开始计数的 ...