原因在于:

  在MyBatis中使用动态语句的判断时,传入的参数(parameterType)为Java基本数据类型,获取的结果(resultType)为JavaBean对象,此时就会抛出该异常,此时可以在参数前添加@Param(“属性名”)注解。

eg:

<select id="allOrders" parameterType="integer" resultType="Order">
select <include refid="allCols"/> from orders
<where>
<if test="state!=null">
state=#{state}
</if>
</where>
</select> 注解:
List<Order>allOrders(@Param("state") Integer state)throws Exception;

MyBatis映射,抛出Cause: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'oid' in 'class java.lang.String'的更多相关文章

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

  2. 已解决: 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 ...

  3. org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'socialCode' in 'class java.lang.String'

    异常: org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.Refl ...

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

  5. 【Mybatis】mybatis查询报错org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'areaName' in 'class java.lang.String'

    mybatis查询报错: Caused by: org.apache.ibatis.reflection.ReflectionException: There is no getter for pro ...

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

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

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

  9. nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'enterpriseId' in 'class java.lang.String'

    错误信息: nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for p ...

随机推荐

  1. python列表的内建函数

    list.append(obj) 向列表中添加一个对象obj list.count(obj) 返回一个对象obj 在列表中出现的次数 list.extend(seq)a 把序列seq 的内容添加到列表 ...

  2. Java开发桌面程序学习(三)——基于Jfoenix库的JFXDialog封装仿Android对话框的工具DialogBuilder

    对话框的封装使用 最近写了个JFXUtils,DialogBuilder也是包含在里面了 JFXUtils的Github 前言 登录需要弹出登录对话框,但是,Jfoenix库使用对话框比较难受,还得动 ...

  3. F4帮助

    在INITIALIZATION之后添加 AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_month-low 事件,s_month-low为要添加的搜索帮助. 下面 ...

  4. ABP开发框架前后端开发系列---(5)Web API调用类在Winform项目中的使用

    在前面几篇随笔介绍了我对ABP框架的改造,包括对ABP总体的介绍,以及对各个业务分层的简化,Web API 客户端封装层的设计,使得我们基于ABP框架的整体方案越来越清晰化, 也越来越接近实际的项目开 ...

  5. Spring Bean的3种装配方式

    Bean常用的装配方式有3种: 基于xml的装配 基于Annotation(注解)的装配 基于Java类的装配 基于xml的装配 在xml文件中配置Bean. 如果依赖很多,xml配置文件会很臃肿,后 ...

  6. 18 | 眼前一亮:带你玩转GUI自动化的测试报告

  7. 跟我学SpringCloud | 第六篇:Spring Cloud Config Github配置中心

    SpringCloud系列教程 | 第六篇:Spring Cloud Config Github配置中心 Springboot: 2.1.6.RELEASE SpringCloud: Greenwic ...

  8. 前端Web浏览器基于Flash如何实时播放监控视频画面(前言)之流程介绍

    [关键字:前端浏览器如何播放RTSP流画面.前端浏览器如何播放RTMP流画面] 本片文章只是起到抛砖引玉的作用,能从头到尾走通就行,并不做深入研究.为了让文章通俗易懂,尽量使用白话描述. 考虑到视频延 ...

  9. java-NIO-DatagramChannel(UDP)

    Java NIO中的DatagramChannel是一个能收发UDP包的通道.因为UDP是无连接的网络协议,所以不能像其它通道那样读取和写入.它发送和接收的是数据包. 打开 DatagramChann ...

  10. 深入理解Java虚拟机笔记——垃圾收集器与内存分配策略

    目录 判断对象是否死亡 引用计数器算法 可达性分析算法 各种引用 回收方法区 垃圾收集算法 标记-清除算法 复制算法 标记-整理算法 分代收集算法 HotSpot算法实现 枚举根节点 GC停顿(Sto ...