Mybatis-There is no getter for property named 'id' in 'class java.lang.String'
<mapper namespace="cn.telchina.standard.mapper.SysOrgnMapper">
<!-- <![CDATA[sql ]]> 尽量每个sql必须写,防止有些特殊字符对sql语句造成的破坏 -->
<select id="queryOrgnList" resultType="SysOrgnModel">
<![CDATA[
select t.* from base.sys_organization t
]]>
<if test="jgid!=null ">
<![CDATA[
where t.fjgid=#{jgid} order by jgbh
]]>
</if>
<if test="jgid==null ">
<![CDATA[
where t.fjgid is null order by jgbh
]]>
</if>
</select>
</mapper>
public List<SysOrgnModel> queryOrgnList( Integer jgid);
会触发Mybatis的错误。
解决办法:public List<SysOrgnModel> queryOrgnList(@Param("jgid") Integer jgid);
原因:
问题分析:Mybatis默认采用ONGL解析参数,所以会自动采用对象树的形式取string.id值,引起报错。
另外一种解决办法:
http://www.cnblogs.com/anee/p/3324140.html
Mybatis-There is no getter for property named 'id' in 'class java.lang.String'的更多相关文章
- 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 ...
- 关于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' ...
- 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 ...
- mybaits错误解决:There is no getter for property named 'id' in class 'java.lang.String'
在使用mybaitis传参数的时候,如果仅传入一个类型为String的参数,那么在 xml文件中应该使用_parameter 来代替参数名. 正确的写法: <span style="f ...
- There is no getter for property named 'id' in class 'java.lang.String'
https://blog.csdn.net/u011897392/article/details/46738747 使用mybatis传入参数,如果在mappin.xml中使用<if>标签 ...
- 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中传参包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 ...
随机推荐
- Python_Tips[6] -> is 和 == 的区别
is和==的区别 / Difference between is and == 对于Python的对象来说,具有id/type/value三种特性,而在判断两个相等的is和==中,分别是对对象的id和 ...
- my-git-wiki-doing
github项目quick setup git初始化 git init git添加remote git remote add origin YOURS_REMOTE_URL git修改remote的u ...
- BZOJ 2669- [cqoi2012]局部极小值
不错的题啊 挺好的结合了容斥和状压DP 保证每个数各不相同,又有大小关系,那么就可以将数字从小到大填. 不难发现 局部极小值<=8,这个可以状压,f[i][j] 表示填了前i个数,局部极小值被填 ...
- 「JXOI2018」游戏
注意输出的应该是 所有方案的和,,而不是期望. 我们不妨把依赖关系建图,可以发现 所有没有入度的点都被查水表了一次 是 游戏结束的 充要条件. 于是我们只需要知道有多少没有入度的点,然后再排列算一算就 ...
- AOJ 0531:Paint Color(二维离散+imos)
[题目链接] http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0531 [题目大意] 给出一张图,和一些矩形障碍物,求该图没被障碍物覆 ...
- Bean 生命周期&&模块化配置
(一)审生命周期 1,配置一个方法作为生命初始化方法Spring会在对象创建后调用(init-method) 2,配置一个方法生命周期的销毁方法,spring容器在关闭并销毁所有容器中的对象之前调用. ...
- linux-系统资源查看-动态
1.top 2.sar http://blog.csdn.net/hguisu/article/details/7493661 很重要 http://blog.itpub.net/24435147/ ...
- MySQL Cluster导入数据表时报错:Got error 708 'No more attribute metadata records (increase MaxNoOfAttributes)' from NDBCLUSTER
准备把以前的非集群版MySQL数据导入到MySQL Cluster中,出现 'No more attribute metadata records (increase MaxNoOfAttribute ...
- python的模块itsdangerous
这个模块主要用来签名和序列化 使用场景: 一.给字符串添加签名: 发送方和接收方拥有相同的密钥--"secret-key",发送方使用密钥对发送内容进行签名,接收方使用相同的密钥对 ...
- flask的session研究和flask-login的session研究
1.httpie的安装:https://github.com/jakubroztocil/httpie#macos 2.http://python.jobbole.com/87450/ 3.http: ...