改成

<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. PHP语法笔记二

    日期函数 date_default_timezone_set(“PRC”):时区设置为中国区 date(“日期格式”[,时间戳]):设置当前或某个时间戳的日期格式. 参数 format 表示时间格式化 ...

  2. SoftmaxWithLoss函数和师兄给的loss有哪些区别呢

    师兄的: NG教程中提到的:

  3. ASP.NET网站发布时的那些坑

    开发工具:VS2010,MVC4.0,SQLSERVER2008 服务器:Windows server 2012,IIS8,SQLSERVER2012 一.发布后,每个页面第一次打开都很卡,50秒或更 ...

  4. docker学习(一)在centos7上安装与启动docker

    CentOS Docker 安装 1.Docker支持以下的CentOS版本: CentOS 7 (64-bit) CentOS 6.5 (64-bit) 或更高的版本 前提条件 目前,CentOS ...

  5. 【sqlite】VS2013中C#读取SQLite数据

    从“火车采集器”(免费版)中获取的网页数据,本地只能自动保存为SQLite数据,(在工具-数据转换中切换).收费版还可以用MySql.SqlServer 今天就记录一下C#读取Sqlite数据 创建一 ...

  6. delete和truncate操作

    SQL> --查询表的结构SQL> desc student; 名称 是否为空? 类型 ----------------------------------------- -------- ...

  7. 【加密算法】PFX文件提取公钥私钥

    方法1: 原版PFX证书 openssl pkcs12 -in myssl.pfx -nodes -out server.pem 提取私钥 openssl rsa -in server.pem -ou ...

  8. memsql 基本安装试用

    备注:使用docker 进行安装 1. 基本准备 a. 环境检查(必须,不然会有服务启动异常的问题) docker run --rm memsql/quickstart check-system b. ...

  9. lapis http verb 处理

    1. 同一个url 包含不同的请求(respond_to  进行解决) // 路由格式 match ,通过respond_to 进行实际的http verb 处理 local lapis = requ ...

  10. UI异常

    为什么chaneTab调用后,这个Tab都消失了? 因为li和table都用同一个ID所以,其中有一个步骤是清空表:$("#XXid").remove,连带着把那个li(tab)也 ...