在使用mybaitis传参数的时候,如果仅传入一个类型为String的参数,那么在 xml文件中应该使用_parameter来代替参数名。

比如mapper中如下方法,只有一个String值
public List<Group> findCityName(String id);
在xml中写法如下:
<select id="findCityName" resultType="com.ly.entity.background.Group">SELECT * from sys_group <where><if test="_parameter != 2"> 此处应该写成 _parameter,而不是parentIdparentId = #{0}</if><if test="_parameter == 2">  此处应该写成 _parameter,而不是parentIdparentId = 2 ORDER BY FIELD(id,316,127,186,164,356,273,226,28,396,3,313)</if></where></select>

如果写成parentId就会报:There is no getter for property named 'parentId ' in class 'java.lang.String'

知识点虽小,但实际解决了问题。在此处记录一下

转载于:https://www.cnblogs.com/julinhuitianxia/p/7150499.html

mybaits错误解决:There is no getter for property named 'parentId ' in class 'java.lang.String'相关推荐

  1. 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 ...

  2. mybatis传单个参数报错:There is no getter for property named 'user_id' in 'class java.lang.String

    org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'user_id' in ...

  3. MyBatis3: There is no getter for property named 'code' in 'class java.lang.String'

    mybatis3  : mysql文如下,传入参数为string类型时'preCode',运行报错为:There is no getter for property named 'preCode' i ...

  4. mybatis There is no getter for property named 'xx' in 'class java.lang.String

    用mybatis查询时,传入一个字符串传参数,且进行判断时,会报 Java代码   There is no getter for property named 'moduleCode' in 'cla ...

  5. Mybatis报错There is no getter for property named 'id' in 'class java.lang.String'

    昨天运行公司项目的一个模块时,后台报了一个错: Caused by: org.apache.ibatis.reflection.ReflectionException: There is no get ...

  6. Mybatis中传参包There is no getter for property named XXX in class java.lang.String

    一.发现问题 <select id="queryStudentByNum" resultType="student" parameterType=&quo ...

  7. 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 ...

  8. SSM框架报错分析(一)——There is no getter for property named 'XXX' in 'class java.lang.String'...

    一.发现问题<select id="queryStudentByNum" resultType="student" parameterType=" ...

  9. Mybatis error,There is no getter for property named 'xx' in 'class java.lang.String',解决办法

    今天在使用Mybatis的时候遇到一个问题,在传递一个String参数的时候遇到下面的错误: Mapper.xml代码如下: 执行这个方法的时候报错: 项目Jar管理用的是Maven,Mybatis版 ...

最新文章

  1. 关于Laravel中使用response()方法调用json()返回数据unicode编码转换的问题解决
  2. c语言程序设计第1章
  3. java鼠标经过时变色_鼠标经过时单元格变色
  4. 解决Another app is currently holding the yum lock; waiting for it to exit...问题
  5. 性能测试 获取 服务器间响应时间,性能测试指标分析TPS、响应时间、并发量等...
  6. Flutter OpenContainer 容器转换过渡 Material Design 设计风格的实践
  7. C++连接MySQL(Windows)
  8. JavaScript 你必须了解的主流趋势!
  9. Adobe Illustrator (AI)安装教程 (附安装包下载资源)
  10. linux源码编译ipk,OpenWrt-SDK-编译生成ipk软件包
  11. spc 统计过程控制(Statistical Process Control)分析软件
  12. 程序员真的很孤独吗?
  13. 计算机修改IP脚本,用脚本修改计算机名和IP地址
  14. 【评测】如何用IPAD作为WIN10系统的拓展屏?
  15. 如何在一只股票坐庄散户敢死队点评
  16. 【NOIP2013模拟】Freda的传呼机
  17. 2019年c++/c,java,python,前端,数据结构,ps等资料大全
  18. 习题 8-28 打结(Knots, ACM/ICPC ACM/ICPC Jakarta 2012, UVa1624)
  19. ETL(kettle)创建工作任务job详解
  20. 投影仪服务器注册商标属于哪类,投影仪商标注册第几类?附:好听的投影仪商标名字...

热门文章

  1. android 获取本机号码需要root吗?
  2. axios请求接口http_Vue使用Axios实现http请求以及解决跨域问题
  3. 大专计算机学语数英理化生吗,学考11-13号报名啦!你知道语数英和政史地/物化生成绩有什么作用嘛?不懂你会后悔的!!...
  4. c语言字母如何代表中文,怎么对中文字符串进行对比
  5. sqlalchemy exists 子查询_学好ORM框架SQLAlchemy面试必问
  6. asp.net多图片上传案例_会计小明的故事-成本核算案例篇
  7. 高德地图只显示一个省_浅谈当下各种导航软件:高德地图、百度地图、腾讯地图...
  8. mysql 表分区 django_MySQL partition分区I
  9. linux降低屏幕亮度,降低屏幕亮度,减缓眼疲劳 (linux/windows/firefox/android)
  10. unity3d api 中文文档_接口文档系统-showdoc安装部署