mybaits错误解决:There is no getter for property named 'parentId ' in class 'java.lang.String'
在使用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,而不是parentId
parentId = #{0}
</if>
<if test="_parameter == 2"> 此处应该写成 _parameter,而不是parentId
parentId = 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'
知识点虽小,但实际解决了问题。在此处记录一下
mybaits错误解决:There is no getter for property named 'parentId ' in class 'java.lang.String'的更多相关文章
- org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'parentId' in 'class java.lang.String'
Caused by: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named ' ...
- Mybatis找不到参数错误:There is no getter for property named 'categoryId' in 'class java.lang.Integer'。
Mybatis找不到参数错误:There is no getter for property named 'categoryId' in 'class java.lang.Integer'. 错误Li ...
- 关于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报错 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 ...
- There is no getter for property named 'userId' in 'class java.lang.String'
[ERROR] 2017-01-18 04:37:06:231 cn.dataenergy.common.CenterHandlerExceptionResolver (CenterHandlerEx ...
- 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 ...
- Caused by: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'zoneId' in 'class java.lang.String'
本文为博主原创,未经允许不得而转载: 异常展示: dao层定义的接口为: public int getClientTotal(); 在mybatis中的sql为: <select id=&quo ...
- 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 ...
- Caused by: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'company' in 'class java.lang.String'
Caused by: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named ' ...
随机推荐
- Dojo初探之2:设置dojoConfig详解,dojoConfig参数详解+Dojo中预置自定义AMD模块的四种方式(基于dojo1.11.2)
Dojo中想要加载自定义的AMD模块,需要先设置好这个模块对应的路径,模块的路径就是这个模块的唯一标识符. 一.dojoConfig参数设置详解 var dojoConfig = { baseUrl: ...
- yum安装phpmyadmin小问题
在CentOS6上面安装phpmyadmin前,加入repo: rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt ...
- MySQL分页优化中的“INNER JOIN方式优化分页算法”到底在什么情况下会生效?
本文出处:http://www.cnblogs.com/wy123/p/7003157.html 最近无意间看到一个MySQL分页优化的测试案例,并没有非常具体地说明测试场景的情况下,给出了一种经典的 ...
- jQuery 插件 的this 指向问题(实战)
daterangepicker 是一个JavaScript组件,用来选择日期. 资源直接搜索 daterangepicker 即可,当然好看的样式可以基于Bootstrap. 官网:http://ww ...
- JDK和Tomcat的简单配置(菜鸟巧记一)
JDK和Tomcat的配置 1.先好安装JDK 1.1先到oracle官网下载合适自己的JDK 地址http://www.oracle.com/technetwork/java/javase/down ...
- Python处理Excel文件
因为工作需求,需要审核一部分query内容是否有效,query储存在Excel中,文本内容为页面的Title,而页面的URL以HyperLink的格式关联到每个Cell. 于是本能的想到用Python ...
- 使用ConfuserEx加密混淆程序以及如何脱壳反编译
一,准备如下工具: ConfuserEx.UnConfuserEx.Fixer.ConfuserExStringDecryptor.ConfuserExSwitchKiller.de4dot.ILSp ...
- 基于Java SE的模拟双色球彩票系统
1.双色球规则: ①双色球分为红球和蓝球,红球选择的范围为1-33,而且红球选择6个数字:蓝球选择的范围为1-16,而且只能选择1个数字. ②选择方式为随机选择号码和手动输入选择号码. ③生成号码的顺 ...
- CSS学习笔记05 display属性
HTML标记一般分为块标记和行内标记两种类型,它们也称块元素和行内元素. 块元素 每个块元素通常都会独自占据一整行或多整行,可以对其设置宽度.高度.对齐等属性,常用于网页布局和网页结构的搭建.并且块级 ...
- C++学习笔记——大杂烩
C++学习笔记--大杂烩 by方阳 版权声明:本文为博主原创文章,转载请指明转载地址 h ...