Exception:There is no getter for property named ‘qo‘ in ‘class cn.xxxxxx.rbac.qo.XxxxQo 的两种错误可能及解决方案
1. 错误信息
HTTP Status 500 - Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named ‘qo’ in 'class cn.wolfcode.rbac.qo.UserQo’
type Exception report
message Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: …
注意:
- 请首先排除在 Qo 中真的没有写 get , set 方法的情况
2. 错误原因1
在方法中忘记写, @Param(“qo”) 的注释
int count(UserQo qo);
3. 解决办法
- 加上注释就可以了
int count(@Param("qo") UserQo qo);
4. 错误原因2
- 在sql查询语句中应该使用 qo的地方忘记写了
<sql id="MySQL"><where><if test="qo.keyword!=null and qo.keyword!=''">and username like conact('%',#{qo.keyword},'%')</if><if test="qo.appId!=null and qo.appId!=-1"><!--错误处-->and appId = #{appId}</if></where></sql>
5. 解决方法
将缺少的地方写上即可
<sql id="MySQL"><where><if test="qo.keyword!=null and qo.keyword!=''">and username like conact('%',#{qo.keyword},'%')</if><if test="qo.appId!=null and qo.appId!=-1"><!--已填上-->and appId = #{qo.appId}</if></where></sql>
如有错误请各位大神指导,叩谢了!!
Exception:There is no getter for property named ‘qo‘ in ‘class cn.xxxxxx.rbac.qo.XxxxQo 的两种错误可能及解决方案相关推荐
- There is no getter for property named ‘keyword‘ in ‘class cn.wolfcode.qo.Subentry‘] with root caus
当使用spring-mybatis集成来对部门员工进行增删改查时,在写员工过滤查询时,会添加两哥关键字和部门的编号,根据页面输入的关键字和数据库的员工的名字和邮箱编号对比,得到过滤查询,出现错误,说关 ...
- There is no getter for property named 'distinct' in 'class cn.ly.item.pojo.SpciGroup'] with root cau
原因对mybatis还不是特别理解 List<SpciGroup> spciGroups = speciGroupMapper.selectByExample(spciGroup); 应该 ...
- 实力踩坑:There is no getter for property named ‘XXX‘ ‘class XXX‘
实力踩坑:There is no getter for property named 'XXX' 'class XXX' 1.异常错误日志 2.分析原因解决 1.异常错误日志 org.apache.i ...
- 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 ...
- 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 ...
- 关于 There is no getter for property named ‘id‘ in ‘class java.lang.Integer‘
errMsg=org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.R ...
- org.apache.ibatis.reflection.ReflectionException: There is no getter for property named XXX
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.Reflecti ...
- There is no getter for property named 'XXX' in class 'aaa.bbb.ccc'(终极骚操作的解决方法)...
使用SpringBoot整合Mybatis时,遇到了像标题的异常,博主当时是用Bean类对象作为参数的,所以百度了很久都没有建设性答案.贴一下报错的xxxDao文件和xxxMapper.xml文件: ...
- 解决 There is no getter for property named ‘null‘ in ‘class 报错
报错内容: Resolved [org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.r ...
最新文章
- .9-Vue源码之AST(5)
- Memcache,Redis,MongoDB(数据缓存系统)方案对比与分析
- 学习这么美丽的事,你要不要和我一起?
- python如何分成两行_python将文本分每两行一组并保存到文件
- 无向图求割点(找桥)tarjan
- GaussDB(for Redis)揭秘:Redis存算分离架构最全解析
- Microsoft.System.Center.Operations.Manager.2007 中文版完整光盘下载地址
- uc3842改可调电源教程_《学习笔记》--DC/DC电源电路设计实例
- ANDROID 4.0 SDK R14 模拟器
- launchMode的几种模式
- C#基础温习(10):C#实现托盘功能
- Extjs5.0从入门到实战开发信息管理系统视频教程
- java jacob pdf_java利用jacob将word转pdf
- 谷歌Keras之父连发两文解析深度学习的局限性与未来
- CocosBuilder 的使用
- 怒肝3W字Java学习路线!从入门到封神全包了(建议收藏)
- python修改文件夹名字
- ValueError: Cannot have number of splits n_splits=10 greater than the number of samples: n_samples=0
- 服务器上模拟手机系统软件,云服务器可以用手机模拟器
- Redis学习之incr命令