mybatis异常:There is no getter for property named 'xxx' in 'xxx'
在使用mybatis查询的时候出现了下面的异常:
org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'dictType' in 'class com.up.sell.vo.system.Advertisement'
at org.apache.ibatis.reflection.Reflector.getGetInvoker(Reflector.java:419) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.reflection.MetaClass.getGetInvoker(MetaClass.java:164) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.reflection.wrapper.BeanWrapper.getBeanProperty(BeanWrapper.java:162) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.reflection.wrapper.BeanWrapper.get(BeanWrapper.java:49) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.reflection.MetaObject.getValue(MetaObject.java:122) ~[mybatis-3.4.6.jar:3.4.6]
这个错误的原因是我的resultMap大小写写错了,大家做好看一下实体中的字段和mapper中的大小写,别搞反。
贴上代码,可以参照一下:
<resultMap type="Advertisement" id="AdvertisementResult">
<id property="id" column="id" />
<result property="title" column="title" />
<result property="imgPath" column="img_path" />
<result property="url" column="url" />
<result property="description" column="description" />
<result property="sort" column="sort" />
<result property="place" column="place" />
<result property="provinceId" column="province_id" />
<result property="cityId" column="city_id" />
<result property="advFlag" column="adv_flag" />
<result property="createUser" column="create_user" />
<result property="createTime" column="create_time" />
<result property="updateUser" column="update_user" />
<result property="updateTime" column="update_time" />
<association property="areas" column="id" javaType="com.up.sell.vo.system.Areas" resultMap="areasResult" />
<association property="dictionary" column="id" javaType="com.up.sell.vo.system.Dictionary" resultMap="deptResult" />
</resultMap> <resultMap id="areasResult" type="Areas">
<id property="id" column="id" />
<result property="areaName" column="area_name" />
<result property="parentId" column="parent_id" />
<result property="shortName" column="short_name" />
</resultMap> <resultMap id="deptResult" type="Dictionary">
<id property="dKey" column="d_key" />
<result property="dValue" column="d_value" />
<result property="dName" column="d_name" />
<result property="parentKey" column="parent_ey" />
<result property="flag" column="flag" />
</resultMap>
mybatis异常:There is no getter for property named 'xxx' in 'xxx'的更多相关文章
- mybatis 异常 There is no getter for property named 'bizId' in 'class java.lang.Long'
mybatis 异常 There is no getter for property named 'bizId' in 'class java.lang.Long' 当使用mybatis进行传参的时候 ...
- Mybatis异常There is no getter for property named 'XXX' in 'class java.lang.String'
1.当入参为 string类型时 (包括java.lang.String.) 我们使用#{xxx}引入参数.会抛异常There is no getter for property named 'XX ...
- Mybatis异常There is no getter for property named 'XXX' in 'class com.xxx.xxx.UserAccountDTO
mybatis报错异常信息如下: 解决: 在接口中加上注解:@Param("userAccountDTO"),如图
- Mybatis异常--There is no getter for property named 'XXX' in 'class java.lang.String'
第一种 在service层加@Param(value="ip") void deleteIpsetup(@Param(value="ip")String ip) ...
- mybatis问题: There is no getter for property named 'equipmentId' in 'class java.lang.String'
本文来源于翁舒航的博客,点击即可跳转原文观看!!!(被转载或者拷贝走的内容可能缺失图片.视频等原文的内容) 若网站将链接屏蔽,可直接拷贝原文链接到地址栏跳转观看,原文链接:https://www.cn ...
- (mybatis)There is no getter for property named 'isEffective' in 'class java.lang.String
原来代码: <select id="findSpecialOffer" resultType="com.lizard.back.model.SpecialOffer ...
- 当传入数据只有一个时mybatis中<if>判断会出现There is no getter for property named 'subjectId' in 'class java.lang.Intege
用"_parameter"代替当前参数 正确: <select id="selectSubjectByPId" parameterType="j ...
- Mybatis-no getter for property named 'col_name' in 'class com.xxx.onebean'
Mybatis中出现该异常 There is no getter for property named 'col_name' in 'class com.xxx.onebean 意思是onebean这 ...
- org.apache.ibatis.reflection.ReflectionException: There is no getter for property named XXX 异常的解决办法。(亲测,一次成功!) #Mybatis
今天在用Mybatis的时,写测试验证插入操作时出现错误org.apache.ibatis.reflection.ReflectionException: There is no getter for ...
随机推荐
- 如何提升SharePoint 2010的性能
文章来自: http://www.chinaemail.com.cn/server/xtfl/Exchange/201109/66466.html SharePoint是微软历史上销售量增长最快的产品 ...
- MySQL入门很简单: 2 MySQL数据类型
2. MySQL数据类型 2.1 整数类型 后面的是默认显示宽度: tinyint(4) smallint(6) mediumint(9) int(11) bigint(20) 2.2 浮点型和定点数 ...
- mysql数据库 thinkphp连贯操作where条件的判断不正确的问题
前两天一直写一个基于thinkphp的东西,遇到从mysql数据库里select数据,where条件一直出现问题的情况.直接上代码: $history = M('history'); $suerId ...
- Android(java)学习笔记67:Android Studio新建工程中的build.gradle、settings.gradle
随着信息化的快速发展,IT项目变得越来越复杂,通常都是由多个子系统共同协作完成.对于这种多系统.多项目的情况,很多构建工具都已经提供了不错的支持,像maven.ant.Gradle除了借鉴了ant或者 ...
- 文本编辑器Vim技巧
1. 导入文件内容 :r 文件名 2. 插入当前日期 :r !date 3. :!which ls 4. :r !命令
- 第23章 I2C—读写EEPROM—零死角玩转STM32-F429系列
第23章 I2C—读写EEPROM 全套200集视频教程和1000页PDF教程请到秉火论坛下载:www.firebbs.cn 野火视频教程优酷观看网址:http://i.youku.com/f ...
- Python 初始—(项目 目录结构)
在os 包下,给出 import os ,os.path.abspath(__file__)获取当前文件的相对路径,os.path.dirname 获取当前文件所在的文件夹目录 print(os.pa ...
- Springcloud Eureka 启动失败:ERROR org.springframework.boot.SpringApplication - Application run failed
在测试Euruka作为服务注册中心的时候碰到了这个问题 [main] ERROR org.springframework.boot.SpringApplication - Application ru ...
- 【Effective C++ 读书笔记】条款02: 尽量以 const, enum, inline 替换 #define
条款02: 尽量以 const, enum, inline 替换 #define 这个条款或许可以改为“宁可以编译器替换预处理器”. 编译过程: .c文件--预处理-->.i文件--编译--&g ...
- qt5.10.1编译记录
qt版本更新比较快,不知道选哪个版本合适,故选择一个较新版本的. 平台imx6 + linux4.1.16 + qt5.10.1 采用明远智睿提供的编译器:fsl-imx-fb-g ...