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 for property named 'moduleCode' in 'class java.lang.String
错误写法:
- <select id="queryAllParentModule" resultType="jobModule" parameterType="jobModule">
- select modulecode,
- modulename,
- modulevalue,
- linkurl,
- rank,
- parentmodule=isnull(parentmodule,1),
- moduledescription
- from job_module
- <where>
- <choose>
- <when test="moduleCode!=null and moduleCode!=''">modulecode = #{moduleCode}</when>
- <when test="moduleCode==null or moduleCode==''">(parentmodule is null or len(parentmodule)<=0)</when>
- </choose>
- </where>
- lt;/select>
需要修改成:
- <select id="queryModuleByCode" resultType="jobModule" parameterType="string">
- select modulecode,
- modulename,
- modulevalue,
- linkurl,
- rank,
- parentmodule=isnull(parentmodule,1),
- moduledescription
- from job_module
- <where>
- <choose>
- <when test="_parameter!=null and _parameter!=''">modulecode = #{_parameter}</when>
- <when test="_parameter==null or _parameter==''">(parentmodule is null or len(parentmodule)<=0)</when>
- </choose>
- </where>
- lt;/select>
不管你的参数是什么,都要改成"_parameter"
REFERENCES:http://txin0814.iteye.com/blog/1533645
---------------------------------------------------------------------------------------------------------------------------------
copyright:http://www.cnblogs.com/anee/
mybatis There is no getter for property named 'xx' in 'class java.lang.String的更多相关文章
- 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 ...
- mybatis之org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'time' in 'class java.lang.String'
mybatis接口 List<String> getUsedCate(String time); 配置文件 <select id="getUsedCate" pa ...
- mybatis问题: There is no getter for property named 'equipmentId' in 'class java.lang.String'
本文来源于翁舒航的博客,点击即可跳转原文观看!!!(被转载或者拷贝走的内容可能缺失图片.视频等原文的内容) 若网站将链接屏蔽,可直接拷贝原文链接到地址栏跳转观看,原文链接:https://www.cn ...
- 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 ...
- 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' 一.发现问题 <select ...
- 【Mybatis】mybatis查询报错org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'areaName' in 'class java.lang.String'
mybatis查询报错: Caused by: org.apache.ibatis.reflection.ReflectionException: There is no getter for pro ...
- 已解决: mybatis报错 org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'xxx' in 'class java.lang.String'
最近在练习MyBatis时 进行姓名的模糊查询时候出现 org.apache.ibatis.exceptions.PersistenceException: ### Error querying da ...
- org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'socialCode' in 'class java.lang.String'
异常: org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.Refl ...
- Mybatis异常There is no getter for property named 'XXX' in 'class java.lang.String'
1.当入参为 string类型时 (包括java.lang.String.) 我们使用#{xxx}引入参数.会抛异常There is no getter for property named 'XX ...
随机推荐
- bzoj 1222 DP
用w[i]表示在A中用了i的时间时在B中最少用多长时间,然后转移就可以了. 备注:这个边界不好定义,所以可以每次用一个cur来存储最优值,然后对w[i]赋值就可以了. /*************** ...
- BZOJ-1861 Book 书架 Splay
1861: [Zjoi2006]Book 书架 Time Limit: 4 Sec Memory Limit: 64 MB Submit: 1010 Solved: 588 [Submit][Stat ...
- USACO 3.3 fence 欧拉回路
题意:求给定图的欧拉回路(每条边只走一次) 若欧拉回路存在,图中只可能有0个or2个奇数度的点. 求解时,若有奇数度的点,则必须从该点开始.否则可以从任一点开始 求解过程:dfs //主程序部分 # ...
- UVA 1398 Meteor
传送门 Solution: 记一颗流星在视野内的时间段为(L, R), 为了使所有(L, R)都取整数,首先将坐标放大. 放大倍数可取为 LCM(1, 2, ..., 10)= 2520 接着计算:从 ...
- IOS基础之 (二) 面向对象思想
编写Objective-C程序时,要使用Foundation框架. 什么是框架? 框架(framework)是由很多类(class)组成的库,可以用来编写程序. 对象(Object) 对象可以保存数据 ...
- NSKeyedArchiver 类 格式
结论:NSKeyedArchiver 以健值对+类名的形式保存数据: NSDictionary *tDic = @{@"kxxxx":@"hhhh",@&quo ...
- autofac 初步学习
//数据处理接口 public interface IDal<T> where T : class { void Insert (T model); void Update(T model ...
- ping 和 traceroute 命令
ping 和 traceroute 命令 ping 程序 就是发送一个ICMP查询报文给某服务器,以测试该服务器是否可达. 当返回ICMP回显应答时,要打印出序列号.TTL,和往返时间: [roo ...
- linux 搭建nginx环境(centos6.5)
1.rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rp ...
- struts2 访问国际化资源 <s:text>作为属性
保留全局级国际化信息资源文件.并在message.properteis中增加一个带有参数的国际化信息. labela = labela in zh_CN labelb = labelb,{0} < ...