mybatis  There is no getter for property named 'xxx' in 'class.....'

在确定该字段在entity中添加了get set方法之后,通常情况报这个错是因为mapper.xml中名称没有保持一致导致的。

<!-- 结果Map --><resultMap id="BaseResultMap" type="com.business.monitor.BaseEquipmentEntity"><result property="relationId" jdbcType="INTEGER" column="f_relation_id"/><result property="equipmentId" jdbcType="VARCHAR" column="f_equipment_id"/><result property="baseId" jdbcType="VARCHAR" column="f_base_id"/><result property="host" jdbcType="VARCHAR" column="f_host"/><result property="port" jdbcType="INTEGER" column="f_port"/><result property="username" jdbcType="VARCHAR" column="f_username"/><result property="password" jdbcType="VARCHAR" column="f_password"/><result property="name" jdbcType="VARCHAR" column="f_name"/><result property="remark" jdbcType="VARCHAR" column="f_remark"/><result property="enterpriseId" jdbcType="VARCHAR" column="f_enterprise_id"/></resultMap>
<!-- 分页查询 -->
<select id="queryByPage" parameterType="com.common.vo.ListVo.ListReqVO"resultMap="BaseResultMap">SELECT
c.f_enterprise_id,
c.f_relation_id,c.f_base_id,c.f_host,c.f_equipment_id,d.f_name,d.f_remark,FROM t_base_equipment AS c INNER JOIN t_internet_things_equipment AS dON c.f_equipment_id = d.f_equipment_id<where>1=1<if test="whereCondition!=null"><if test="whereCondition.enterpriseId!=null">AND c.f_enterprise_id = #{whereCondition.enterpriseId,jdbcType=VARCHAR}</if><if test="whereCondition.relationId!=null">AND f_relation_id = #{whereCondition.relationId,jdbcType=INTEGER}</if><if test="whereCondition.host!=null and whereCondition.host!=''">AND f_host like CONCAT('%',#{whereCondition.host,jdbcType=VARCHAR},'%')</if><if test="whereCondition.name!=null and whereCondition.name!=''">AND d.f_name like CONCAT('%',#{whereCondition.name,jdbcType=VARCHAR},'%')</if></if></where>
</select>

其中

<result property="enterpriseId" jdbcType="VARCHAR" column="f_enterprise_id"/>

<if test="whereCondition.enterpriseId!=null">AND c.f_enterprise_id = #{whereCondition.enterpriseId,jdbcType=VARCHAR}</if>

//property的字段名称一致,column为数据库中字段名要一致,即例子中红色位置与红色一致,蓝色位置与蓝色一致。

//这是我在使用中遇到的问题及解决,当时名称未保持一致,出现如题的报错情况,将名称更正一致后,问题解决。

There is no getter for property named 'xxx' in 'class.....'相关推荐

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

  2. Mybatis There is no getter for property named 'XXX' in 'class java.lang.XXX

    Mybatis查询 使用Mybatis查询时,其参数可以是基本数据类型或者像Integer和String这样的简单的数据对象,也可以是复杂对象(一般是指JavaBean)或者map等,当使用基本数据类 ...

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

  4. There is no getter for property named ‘xxx‘ in ‘class com.test.project.entity.

    SpringBoot 项目使用mybatis操作数据库时报错 There is no getter for property named 'xxx' in 'class com.test.projec ...

  5. 实力踩坑: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 ...

  6. There is no getter for property named xxx in xxx

    这里记录一下bug.使用mybatis报错! 启动项目是正常的,访问报错: 2020-06-30 11:38:28.988 | ERROR | | | http-nio-8080-exec-1 -&g ...

  7. 解决There is no getter for property named 'xxx' in 'classxxxx'

    今天在做新增时遇到的报错. Caused by: org.apache.ibatis.reflection.ReflectionException: There is no getter for pr ...

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

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

  9. There is no getter for property named 'XXX' in class 'aaa.bbb.ccc'(终极骚操作的解决方法)...

    使用SpringBoot整合Mybatis时,遇到了像标题的异常,博主当时是用Bean类对象作为参数的,所以百度了很久都没有建设性答案.贴一下报错的xxxDao文件和xxxMapper.xml文件: ...

最新文章

  1. 库克退休前的最后一战:不是苹果汽车而是……
  2. 关于Java HotSpot(TM) 64-Bit Server VM warning: Insufficient space for shared memory file: 11043的解决办...
  3. 银行家算法的分析与实现
  4. 基于特征的对抗迁移学习论文_lt;EYD与机器学习gt;迁移学习:PTL选择式对抗网络...
  5. php对接钉钉_PHP使用POST方法与钉钉对接无返回结果的问题
  6. c语言怎么让图形界面单独显示,「分享」C语言如何编写图形界面
  7. 为什么我的JVM访问的内存少于通过-Xmx指定的内存?
  8. pandas尾部添加一条_Numpy与Pandas
  9. 3串锂电池电量检测ic bq2060pdf及应用原理图_接受电源IC需求挑战,轻松实现精确调节的电源电压!...
  10. 12.2 新特性:锁信息获取之在线删除索引
  11. python测试系列教程 —— 调试日志logging
  12. 深信服桌面云的各种密码
  13. HTML教程: 网页字体的设置浅谈
  14. idea 找出TODO
  15. js根据给定颜色生成更亮/暗/颜色
  16. 【Hide-and-Seek】《Hide-and-Seek: A Data Augmentation Technique for Weakly-Supervised Localization xxx》
  17. 【开发】开源的网络攻防黑客游戏d0x3d
  18. Ubuntu X86编译安装Gstreamer nvenc插件(硬件编码)
  19. Android平台使用-谷歌广告联盟AdMob-赚取收益的编程方法
  20. CPU中的MESI协议(Intel)

热门文章

  1. Camtasia Studio实现画中画视频课件制作方案
  2. 99、详解一个交换机能带动多少个网络监控摄像头
  3. verilog脉冲产生高电平
  4. 音像制品销售系统的设计与实现
  5. React仿大众点评外卖app
  6. Java高尔夫_2011年高尔夫巡回赛
  7. 企业邮箱如何代理?企业邮箱哪家好用?
  8. vue 自定义指令 directive 全局 directives 局部 inserted update
  9. 初学 Sliding Window 之个人笔记
  10. 苹果cms10自适应免费好看带直播的橙色模板