在使用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'的更多相关文章

  1. 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进行传参的时候 ...

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

  3. Mybatis异常There is no getter for property named 'XXX' in 'class com.xxx.xxx.UserAccountDTO

    mybatis报错异常信息如下: 解决: 在接口中加上注解:@Param("userAccountDTO"),如图

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

  5. mybatis问题: There is no getter for property named 'equipmentId' in 'class java.lang.String'

    本文来源于翁舒航的博客,点击即可跳转原文观看!!!(被转载或者拷贝走的内容可能缺失图片.视频等原文的内容) 若网站将链接屏蔽,可直接拷贝原文链接到地址栏跳转观看,原文链接:https://www.cn ...

  6. (mybatis)There is no getter for property named 'isEffective' in 'class java.lang.String

    原来代码: <select id="findSpecialOffer" resultType="com.lizard.back.model.SpecialOffer ...

  7. 当传入数据只有一个时mybatis中<if>判断会出现There is no getter for property named 'subjectId' in 'class java.lang.Intege

    用"_parameter"代替当前参数 正确: <select id="selectSubjectByPId" parameterType="j ...

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

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

随机推荐

  1. Azure进阶攻略丨如何驾驭罢工的Linux虚机网卡?

    很多人的生活中,流传着一个屡试不爽,据说可以解决任何问题的百宝锦囊: 所以经常可以听到类似这样的对话: -我的电脑咋上不去网了? -重启一下电脑. -还是不行呢! -重启一下路由器. -怎么还不行-_ ...

  2. "ssllabs" website and "testssl" website

    "https://www.ssllabs.com" could scan your server and give results about the weakness of yo ...

  3. 关于java中的hashcode和equals方法原理

    关于java中的hashcode和equals方法原理 1.介绍 java编程思想和很多资料都会对自定义javabean要求必须重写hashcode和equals方法,但并没有清晰给出为何重写此两个方 ...

  4. 关于 no device found for connection ‘ System eth0′问题

    在Vmware上面安装CentOS,开机后,使用:service network restart时,会提示一下错误: Shutting down loopback interface:         ...

  5. 微信的 rpx

    微信小程序新单位rpx与自适应布局   rpx是微信小程序新推出的一个单位,按官方的定义,rpx可以根据屏幕宽度进行自适应,在rpx出现之前,web页面的自适应布局已经有了多种解决方案,为什么微信还捣 ...

  6. create-react-app项目使用假数据

    做新项目的时候,前端每次要等后端接口准备好再开始,就会延期,等后端接口准备好了,前端这边的项目又会相互紧张,如果前端跟后端同时进行,前期将框架,基础做好,定好接口文档,前端在后端没准备好接口的时候使用 ...

  7. php图像处理插件imagick安装(仅适用于86位,php5.4非安全环境-16px)

    phpImageMagick-6.7.7-5-Q16-windows-dll(加测试代码,经测试,仅适用于86位,php5.4安全环境-16px) 下载地址:http://pan.baidu.com/ ...

  8. 裁剪插件jCrop

    为大家介绍个插件:jCrop.这个插件被我用在了多个项目中,如通过画热力图来查看某块地方用户的浏览数,放大缩小拖动选框来实时预览所选区域的图片病裁剪,设置头像是选框必须要是正方形,它有着丰富的配置参数 ...

  9. python非字符串与字符产链连接

    第一种办法: "hello" +' '+str(110) 输出结果: 'hello 110' 第二种办法: import numpy x = 110 print 'hello(%d ...

  10. Linux操作系统下的三种Java环境配置方法

    方法1:修改/etc/profile 文件  所有用户的 shell都有权使用这些环境变量 (1)在 shell终端执行命令:vi /etc/profile (2)在 profile文件末尾加入: e ...