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 ...
随机推荐
- 小白入门篇:flex布局
--前言 因为这个星期写一个小的项目用到flex布局和grid布局,虽然这两种布局都是兼容性都有问题,但是别急,我觉的以后肯定是会发展并且流行起来的,毕竟google大法好,而且这两个布局真的比一般的 ...
- 《JAVA与模式》之观察者模式(转载)
<JAVA与模式>之观察者模式(转载) 原文链接:http://www.cnblogs.com/java-my-life/archive/2012/05/16/2502279.html ...
- Codeforces 1037F. Maximum Reduction
总感觉我这种做法会T,一直没写,看了其他人的题解也是这样,,,就果断写了,,可能数据不太深,或者玄学复杂度 题意即求xk-1长度的所有区间的最大值的和,对每一个i(数组下边),他对答案的贡献数量就是在 ...
- shell 查找目录
查找目录:find /(查找范围) -name '查找关键字' -type d
- UOJ 180【UR #12】实验室外的攻防战
http://uoj.ac/contest/25/problem/180 从前往后对比串A,B 当$A_i,B_i$不相同时找到$B_i$在A中的位置j 若$min{A_1,A_2,A_3...... ...
- 四. Java继承和多态2. Java super关键字
super 关键字与 this 类似,this 用来表示当前类的实例,super 用来表示父类. super 可以用在子类中,通过点号(.)来获取父类的成员变量和方法.super 也可以用在子类的子类 ...
- spring属性注入
1,set方法注入 (1)对于值类型的属性: 在对象中一定要有set方法 package com.songyan.demo1; import com.songyan.injection.Car; /* ...
- Android简单的利用MediaRecorder进行录音的实例代码
MainActivity.java package com.example.soundrecord_demo; import java.io.IOException; import android.m ...
- LCIS线段树(区间更新)
首先线段树每一个节点包含:[b,e],lmax,rmax,max;其中lmax表示从左端点开始连续的最长的增序列长度,rmax表示从e端点开始向左连续的最长下降序列长度,max表示当前区间的连续递增的 ...
- codeforces559A--Gerald's Hexagon(计算几何)
A. Gerald's Hexagon time limit per test 2 seconds memory limit per test 256 megabytes input standard ...