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 ...
随机推荐
- 在CentOS 7上安装Node.js
一.安装1.进入官网下载最新版本https://nodejs.org/en/ 选择下载后上传或直接使用wget下载 wget https://nodejs.org/dist/v8.11.2/node- ...
- luogu P1075 质因数分解
题目描述 已知正整数n是两个不同的质数的乘积,试求出两者中较大的那个质数. 输入输出格式 输入格式: 输入只有一行,包含一个正整数n. 输出格式: 输出只有一行,包含一个正整数p,即较大的那个质数. ...
- centos iptables关于ping
配置iptables策略后,一般来说INPUT都是DROP然后配置需要通过的 当执行: iptables -P INPUT DROP 后,机器就不能被ping通了! 因为icmp没有添加到规则中! 于 ...
- 阅读 Android源码的一些姿势
日常开发中怎么阅读源码 找到正确的源码 IDE 是日常经常用的东西,Eclipse 就不说了,直接从 Android Studio(基于 IntelliJ Community 版本改造)开始. 我们平 ...
- jq和js中click 事件的几种方式总结和click事件的累加问题解决办法
1:常见的三种绑定click事件: 第一种:$("#click").click(function(){ alert("Hello World click") ...
- ODS与EDW的区别
http://blog.csdn.net/bitcarmanlee/article/details/51013474 根据自己的理解与实际项目经验,说说ODS与EDW的异同.如果有不对的地方,欢迎大家 ...
- memcache运行机制(转)
网上其实有很多文章说明了memcached是如何运作的,特别是底层的内存分配是如何运作的.我参考过很多资料,比较有启发意义的有几个: 首先是官方的英文资料,虽然文章太多.很难看懂,我个人觉得说得也不是 ...
- 【重点突破】—— Easy Mock的使用及Mock.js规范
前言:在线使用Easy Mock可视化工具,可以提供快速生成“模拟数据”的持久化服务: Mock.js是一个JS插件,指定了一套规范,而Easy Mock工具就遵循这些规范. 一.Easy Mock ...
- HTML5 Canvas 六角光阑动态效果
光阑是光具组件中光学元件的边缘.框架或特别设置的带孔屏障,本人实现了结构比较简单的六角光阑,效果有点像宇航员在徐徐张开的飞船舷窗中看到逐渐完整的地球,下面四张图可以感受一下. 当然看动态效果才能真正体 ...
- HUNAN Interesting Integers(爆力枚举)
Undoubtedly you know of the Fibonacci numbers. Starting with F1 = 1 and F2 = 1, every next number is ...