改成

<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. 获取SQL Server数据库表的列名

    SELECT syscolumns.name,systypes.name,syscolumns.isnullable,syscolumns.length FROM syscolumns, systyp ...

  2. PHP convet class to json data

    /********************************************************************* * PHP convet class to json da ...

  3. (转)3D LUT

    这是 @Air君·Saunato·LoFoTo 大神运用3DLUT的作品 这是借用昔年大神 @昔年Olivia 用3DLUT的片片 http://paopaopaojiao.lofter.com/po ...

  4. XPath element 格式

    一.xpath表达式的基本格式 xpath通过“路径表达式”(Path Expression)来选择节点. # 斜杠(/)作为路径内部的分割符. # 同一个节点有绝对路径和相对路径两种写法. # 绝对 ...

  5. 使用django搭建博客并部署

    2017/8/31 18:27:59 为了以后参考的方便,在这里总结一下django搭建博客网站的主要步骤.以下大部分的内容,参考自Django中文文档 - 看云. 需要强调的是,这里使用的djang ...

  6. C++头文件预编译与命名空间使用方法

    宏指令的预编译用法,用于多文件的头文件预编译判断 头文件代码: #include <iostream> #ifndef XB_H//预编译判断XB_H代码段是否被执行 #define XB ...

  7. BZOJ5281: [Usaco2018 Open]Talent Show(01分数规划&DP)

    5281: [Usaco2018 Open]Talent Show Time Limit: 10 Sec  Memory Limit: 128 MBSubmit: 166  Solved: 124[S ...

  8. 《selenium2 python 自动化测试实战》(8)——定位iframe

    我们来看一段最早的代码: # coding: utf-8 from selenium import webdriverfrom time import sleep driver = webdriver ...

  9. Web应用程序开发知识点回顾

    asp.net 1.<%@ Page Language="C#"AutoEventWireup="true" CodeFile="Home.as ...

  10. 开始学习jQuery

    一 jQuery是什么? 1. jQuery由美国人John Resig创建,至今已吸引了来自世界各地的众多 javascript高手加入其team. 2.jQuery是继prototype之后又一个 ...