1.mybatis bug之resultmap缺少object-relation匹配参数password,造成设置密码不成功

在resultmap里没有设置user类中password属性和数据库表tbl_user的password字段的匹配,造成在执行update的操作时候,无法把user中的password更新到数据库表中。

解:userMapper.xml

<resultMap id="BaseResultMap" type="User" extends="SimpleResultMap">
<id property="uid" column="uid" /> <result property="unionid" column="unionid"/>
<result property="openid" column="openid"/>
<result property="age" column="age"/>
<result property="birthday" column="birthday"/>
<result property="sex" column="sex"/>
<result property="phone" column="phone"/>
<result property="email" column="email"/>
<result property="qq" column="qq"/>
<result property="wechat" column="wechat"/>
<result property="province" column="province"/>
<result property="city" column="city"/>
<result property="country" column="country"/>
<result property="channel" column="channel"/>
<result property="password" column="password"/> <!-- SimpleResultMap 中已经有
<result property="nickname" column="nickname"/>
<result property="headimgurl" column="headimgurl"/>
<result property="appid" column="appid"/>
<result property="password" column="password"/>
-->
<result property="backgroundimg" column="backgroundimg"/>
<result property="description" column="description"/>
<result property="createTime" column="create_time"/> </resultMap> <resultMap id="SimpleResultMap" type="User">
<id property="uid" column="uid" />
<result property="nickname" column="nickname"/>
<result property="headimgurl" column="headimgurl"/>
</resultMap>
<update id="update">
update tbl_user
<set>
<trim suffixOverrides=",">
<if test="phone != null">
phone = #{phone},
</if>
<if test="age != null">
age = #{age},
</if>
<if test="birthday != null">
birthday = #{birthday},
</if>
<if test="email != null">
email = #{email},
</if>
<if test="qq != null">
qq = #{qq},
</if>
<if test="wechat != null">
wechat = #{wechat},
</if>
<if test="sex != null">
sex = #{sex},
</if>
<if test="nickname != null">
nickname = #{nickname},
</if>
<if test="province != null">
province = #{province},
</if>
<if test="headimgurl != null">
headimgurl = #{headimgurl},
</if>
<if test="city != null">
city = #{city},
</if>
<if test="password != null">
password = #{password},
</if>
<if test="backgroundimg != null">
backgroundimg = #{backgroundimg},
</if>
<if test="description != null">
description = #{description},
</if>
</trim>
</set>
<where>
uid = #{uid}
</where> </update>

mybatis bug之resultmap缺少object-relation匹配参数password,造成设置密码不成功的更多相关文章

  1. 解决 Mybatis 元素类型为 "resultMap" 的内容必须匹配 "(constructor?,id*,result*,association*,collection*,discriminat

    在配置 mybatis mapper.xml文件时, 一不小心就会报如下类似的异常: Caused by: org.springframework.beans.factory.BeanCreation ...

  2. ORM(Object/Relation Mapping)框架简介

    ORM 框架简介 对象-关系映射(Object/Relation Mapping,简称ORM),是随着面向对象的软件开发方法发展而产生的.面向对象的开发方法是当今企业级应用开发环境中的主流开发方法,关 ...

  3. Mybatis映射文件中#取值时指定参数相关规则

    Mybatis映射文件中#取值时指定参数相关规则 在#{}中,除了需要的数值外,还可以规定参数的一些其他规则. 例如:javaType,jdbcType,mode(存储过程),numericScale ...

  4. wx.navigateBack(OBJECT)怎么携带参数呢?

    wx.navigateBack(OBJECT) 关闭当前页面,返回上一页面或多级页面.可通过 getCurrentPages() 获取当前的页面栈,决定需要返回几层. OBJECT 参数说明: 参数 ...

  5. swagger 接口文档,控制器 和 object类型的参数与返回值 的 注释不显示问题

    一.控制器的注释不显示:是因为配置swagger的时候没有将includeControllerXmlComments参数配置为true,因为其默认值为false 二.object 类型的参数和返回值 ...

  6. mybatis+mysql返回插入的主键,参数只是提供部分参数

    mybatis+mysql返回插入的主键,参数只是提供部分参数 <insert id="insertByChannelIdOpenid" useGeneratedKeys=& ...

  7. spring和mybatis整合时Access denied for user '***'@'localhost' (using password: YES)错误的解决方案

    参考文章:博客园文章 参考解决办法: 将数据库配置文件格式 key=value 改为 jdbc.key=value 以下为问题分析 使用Spring + Mybatis + Mysql整合时,测试报错 ...

  8. 错误Mybatis 元素类型为 "resultMap" 的内容必须匹配 "(constructor?,id*,result*,association*,collection*,discriminat

    今天算是见识了什么事顺序的重要性. 在使用mybatis时由于联合了其他的表,用到了resultMap,之后外加association这一项.可是在替换对应字段的位置上加上association总是报 ...

  9. Mybatis 元素类型为 "resultMap" 的内容必须匹配 "(constructor?,id*,result*,association*,collection*,discriminat

    <resultMap id="BaseResultMap" type="com.youotech.tl_cons_credit_rating.entity.TL_C ...

随机推荐

  1. git 学习笔记1

    目前我属于粗放型的[学习者],接下来需要做一些改变,让自己更加规范.首先需要学习的就是版本控制系统,本科在工作室的时候使用过一点Subversion,不过到现在已经基本没有印象了.git现在越来越成为 ...

  2. 解决qt提示:qt.network.ssl: QSslSocket: cannot call unresolved function DH_free和qt.network.ssl: QSslSocket: cannot call unresolved function d2i_DHparams

    转载请注明出处:https://i.cnblogs.com/EditPosts.aspx?postid=7127254 运行环境:VS2015&Qt5.8 方法一(未能解决):把C:\Qt\Q ...

  3. 【译】x86程序员手册34-9.7错误代码

    9.7 Error Code 错误代码 With exceptions that relate to a specific segment, the processor pushes an error ...

  4. 迅为iTOP-4418嵌入式开发板初体验

    iTOP-4418开发板预装 Android4.4.4 系统, 支持9.7 寸.7 寸.4.3 寸屏幕. 参数:核心板参数 尺寸 50mm*60mm高度 核心板连接器为1.5mmCPU ARM Cor ...

  5. uiviewcontroller顶级布局控制

    @available(iOS 7.0, *) open var edgesForExtendedLayout: UIRectEdge // Defaults to UIRectEdgeAll @ava ...

  6. rsync_ssh

    rsync -av -e "ssh" /data/wwwroot/a1 node2:/data/wwwroot/

  7. XP禁用了U盘和移动硬盘方法

    会不会是你XP禁用了U盘和移动硬盘下面这些是任何禁用U盘的!你自己反着试下嘛!方法一,BIOS设置法(快刀斩乱麻法) 进入BIOS设置,选择“Integrated Peripherals”选项,展开后 ...

  8. myeclipse出现Failed to load JavaHL Library.

    eclipse启动出现如图的状况: 解决方法: Window-Preferences-Team-SVN,在SVN接口的下拉框可以看到,默认选择的是JavaHL(JNI) Not Available,手 ...

  9. Android-ViewPagerIndicator框架使用——CirclePageIndicator

    前言:Circle适用于应用新功能的展示页和商品的多张图片的展示功能. 1.定义布局文件:SampleCirclesDefault中添加了一个布局:simple_circles. 布局中定义一个Lin ...

  10. 56.fielddata filter的细粒度内存加载控制

    语法: POST /test_index/_mapping/test_type { "properties": { "test_field": { " ...