Mybatis中传参包There is no getter for property named 'XXX' in 'c
分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow
也欢迎大家转载本篇文章。分享知识,造福人民,实现我们中华民族伟大复兴!
一、发现问题
<select id="queryStudentByNum" resultType="student" parameterType="string">
select num,name,phone from student
<where>
<if test = " num!=null and num!='' ">
AND num = #{num}
</if>
</where>
</select>
Mybatis查询传入一个字符串传参数,报There is no getter for property named 'num' in 'class java.lang.String'。
二、解决问题
<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"。
三、原因分析
Mybatis默认采用ONGL解析参数,所以会自动采用对象树的形式取string.num值,引起报错。也可以public List methodName(@Param(value="num") String num)的方法说明参数值
参考博客:
http://blog.sina.com.cn/s/blog_86e49b8f010191hw.html
http://txin0814.iteye.com/blog/1533645
感觉有帮助请您赏一杯茶钱,金额随意。您的鼓励是我写作的动力。
给我老师的人工智能教程打call!http://blog.csdn.net/jiangjunshow
Mybatis中传参包There is no getter for property named 'XXX' in 'c相关推荐
- Mybatis中传参包There is no getter for property named XXX in class java.lang.String
一.发现问题 <select id="queryStudentByNum" resultType="student" parameterType=&quo ...
- Mybatis占位符问题—ReflectionException: There is no getter for property named xxx
使用${}占位符时(PS:一般都使用#{},不建议使用${}),发现xml文件中的SQL语句使用了$后会报错:具体情况如下: 解决方案如下:在参数前加上@Param("id")注解
- Mybatis There is no getter for property named 'XXX' in 'class java.lang.XXX
Mybatis查询 使用Mybatis查询时,其参数可以是基本数据类型或者像Integer和String这样的简单的数据对象,也可以是复杂对象(一般是指JavaBean)或者map等,当使用基本数据类 ...
- Mybatis异常There is no getter for property named ‘XXX‘ in ‘class java.lang.String‘
Mybatis异常There is no getter for property named 'XXX' in 'class java.lang.String' 参考文章: (1)Mybatis异常T ...
- mybatis 报错There is no getter for property named 'XXX' in 'class com.xx.xx'
mybatis报错信息记录: ### Error querying database. Cause: org.apache.ibatis.reflection.ReflectionException ...
- MyBatis There is no getter for property named ‘xxx‘ in ‘class xxx‘问题解决
问题描述: org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.Re ...
- MyBatis遇到:There is no getter for property named ‘Xxx‘ in ‘class xxx.xxx.Xxx‘问题
问题 org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.apache ...
- 使用mybatis-plus时mybatis报错There is no getter for property named ‘xxx‘ in ‘class com.xxx.xxx.xxxMybatis
今天给项目的数据字典查询添加通用方法,发现里边已经有了一个查询所有数据字典的方法 List<Dict> selectDictList(); 但我想设置的方法是根据数据字典的code查询出所 ...
- mybatis中传集合时 报异常 invalid comparison: java.util.Arrays$ArrayList and java.lang.String
mybatis中传集合时 报异常 invalid comparison: java.util.Arrays$ArrayList and java.lang.String 参考文章: (1)mybati ...
- python 构造函数传参_C++和python混合编程之在python类构造函数中传参方法
C++和python混合编程 零.前言 一.说明 二.测试代码 1.C++代码 2.python代码 三.运行结果 零.前言 C++是一门高效率的语言,Python是一门简单易学的脚本语言,现在Pyt ...
最新文章
- 就挺凡尔赛的!李开复谈20年后的AI,崔宝秋论开源之道,清华唐杰的PPT成了“香饽饽” | MEET2021智能未来大会...
- Re题目------Enm.exe
- C# WPF MVVM开发框架Caliburn.Micro快速搭建③
- kafak消费者从头开始消费(消费者组)
- python可以用来整理表格吗_Python将多份excel表格整理成一份表格
- 确保您的Silverlight 1.0运行时间组件是最新版本
- c++禁止进程被结束_第四章 进程管理
- ScheduledExecutorService线程调度的使用
- 大数据之-Hadoop伪分布式_NameNode格式化注意事项---大数据之hadoop工作笔记0025
- linux 混杂设备 miscdevice设备介绍
- Java Collection框架入门
- windows phone (24) Canvas元素A
- Atitit datatype 数据类型 目录 第一章 三大基本类型 数字 字符串 bool	1 第二章 基本类型vs引用类型	1 字符串类型	2 第三章 符合类型vs 简单类型	2 特殊类型
- linux命令join的用法,linux join命令
- 网络表情NLP(一)︱颜文字表情实体识别、属性检测、新颜发现
- 怎么用计算机向手机上传照片,华为手机怎么传照片到电脑上去?华为手机往电脑传照片方法...
- Node.js中实时显示下载进度并解压文件
- MFC如何添加bmp文件和ICO文件
- SSH登录的两种方式
- 【vim】禁止vim生成 un~文件
热门文章
- 利用R语言的Boruta包进行特征选择
- 精选| 2019年5月R新包推荐(Top40)
- C#添加二维码带加密带logo
- docker入门2---docker的初体验
- Modelsim调用用do脚本自动化仿真
- django1.9 创建数据表
- Spring-MVC案例:Spitter的笔记
- [UVa11995] I Can Guess the Data Structure!
- android Xmpp+openfire 消息推送 :SASL authentication failed using mechanism DIGEST-MD5
- k进制正整数的对k-1取余与按位取余