改成

<select id="queryStudentByNum" resultType="student" parameterType="string">

select num,name,phone from student  
<where> 
<if test = " _parameter!=null and_parameter!='' ">
AND num = #{_parameter}
</if>
</where>
</select>
无论参数名,都要改成"_parameter"。

要加上parameterType="string"  然后把参数改成_parameter

原因分析

Mybatis默认采用ONGL解析参数,所以会自动采用对象树的形式取string.num值,引起报错。也可以public List methodName(@Param(value="num") String num)的方法说明参数值

Mybit错误,提示There is no getter for property named 'tid' in 'class java.lang.String'的更多相关文章

  1. Mybatis找不到参数错误:There is no getter for property named 'categoryId' in 'class java.lang.Integer'。

    Mybatis找不到参数错误:There is no getter for property named 'categoryId' in 'class java.lang.Integer'. 错误Li ...

  2. 关于mybtis 使用过程中发生There is no getter for property named 'id' in class 'java.lang.String' 错误

    今天在修改一个关于mybtis语句时,偶然发现的一个错误  There is no getter for property named 'id' in class 'java.lang.String' ...

  3. mybaits错误解决:There is no getter for property named 'parentId ' in class 'java.lang.String'

    在使用mybaitis传参数的时候,如果仅传入一个类型为String的参数,那么在 xml文件中应该使用_parameter来代替参数名. 比如mapper中如下方法,只有一个String值 publ ...

  4. MyBatis3: There is no getter for property named 'code' in 'class java.lang.String'

    mybatis3  : mysql文如下,传入参数为string类型时‘preCode’,运行报错为:There is no getter for property named 'preCode' i ...

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

    转载自://http://www.cnblogs.com/anee/p/3324140.html 用mybatis查询时,传入一个字符串传参数,且进行判断时,会报 There is no getter ...

  6. There is no getter for property named 'userId' in 'class java.lang.String'

    [ERROR] 2017-01-18 04:37:06:231 cn.dataenergy.common.CenterHandlerExceptionResolver (CenterHandlerEx ...

  7. Mybatis问题:There is no getter for property named 'unitId' in 'class java.lang.String'

    Mybatis遇到的问题 问题: org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.re ...

  8. Caused by: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'zoneId' in 'class java.lang.String'

    本文为博主原创,未经允许不得而转载: 异常展示: dao层定义的接口为: public int getClientTotal(); 在mybatis中的sql为: <select id=&quo ...

  9. Mybatis笔记四:nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'id' in 'class java.lang.String'

    错误异常:nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for pr ...

随机推荐

  1. iOS 11 Xcode 开发包SDK

    一不小心,手机又升级了,哎

  2. swift 数组作为函数参数的书写格式

    数组定义 --[来自百度知道] Swift语言使用类型名紧接中括号[]来简化标准库中定义的命名型类型Array.例如 Array<String> = ["Alex", ...

  3. [Python]定时任务框架 APScheduler

    1.使用APScheduler教程 参考博客地址

  4. 写一个Python的windows服务

    1. 安装pywin32和pyinstaller pip install pywin32 pip install pyinstaller 2.写一个服务Demo # -*- coding: utf-8 ...

  5. Python:版本升级(Mac OS X)

    Mac OS X 10.8及以后的版本都预装了Python 2.7,但是在Mac上(Unix-like OS)上修改Python的版本并不如Windows方便.这篇文章的目标是要将Mac自带的Pyth ...

  6. Jmeter用表格查看结果

    Sample#:编号类似id Start Time:开始时间 Thread Name:线程名称 Label:请求名称 Sample Time:取样时间ms Status:状态 Bytes:接受字节数 ...

  7. IDEA中项目统一编码格式设置

    统一UTF-8编码设置 第一处 File-settings-Editor-File Encodings 第二处 File-Other settings-Default settings 第三处 tom ...

  8. linux自学(三)之开启虚拟机

    上一篇:linux自学(二)之centos7镜像安装 前面都已经铺垫好了,下面就是开始安装镜像了,真正的开启一台linux机器. 点击开启此虚拟机,如图: 之后就是等待了,然后就是开始配置,首先如下图 ...

  9. 7-4线性分组码的matlab程序

    补充一点,关于生成矩阵G和校验矩阵H的关系:生成矩阵G是4*7矩阵,分为两块,前4列组成的4*4矩阵为单位矩阵,后3列组成的4*3矩阵我称它监督矩阵,校验矩阵是3*7矩阵,前4列组成的3*4矩阵是监督 ...

  10. centos6.5 ifconfig没有ipv4地址

    进入/etc/sysconfig/network-scripts/目录中,可以看到ifcfg-eth0文件, vi ifcfg-eth0编辑文件, 将“ONBOOT=no” 选项改成“ONBOOT=y ...