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. Asp.Net控件的客户端命名

    我们在用ASP.NET写出来的网页,用浏览器来查看生成的客户端代码的时候经常看到这样的代码:GridView1_ctl101_WebUserControl1_webuserControlButton, ...

  2. iis 配置文件解决跨域问题

    <system.webServer> <httpProtocol> <customHeaders> <add name="Access-Contro ...

  3. 深入理解python对象及属性

    类属性和实例属性首先来看看类属性和类实例的属性在python中如何存储,通过__dir__方法来查看对象的属性 >>> class Test(object): pass>> ...

  4. 20181017 work - Inno Setup 禅道 xp系统 楷体字体 win10倒计时 nwjs chosen

    win10 闹钟和时钟 用个倒计时 Inno Setup 编译器 把应用程序打包成安装程序 nwjs-v0.14.7-win-ia32 XP专用 chrome用的49的版本 作用是把浏览器地址的程序打 ...

  5. pycharm 编写前端代码一些小技巧

    <!DOCTYPE html><html lang="zh-CN"><head> <meta charset="UTF-8&qu ...

  6. java_tcp_简单示例

    package netProgram; import java.io.DataOutputStream; import java.io.IOException; import java.net.Ser ...

  7. 第3节 hive高级用法:16、17、18

    第3节 hive高级用法:16.hive当中常用的几种数据存储格式对比:17.存储方式与压缩格式相结合:18.总结 hive当中的数据存储格式: 行式存储:textFile sequenceFile ...

  8. java 解析json格式数据

    有时候可能会用到json格式进行数据的传输,那么怎么把接收到的数据解析出来呢? 下面介绍两种解析json数据的方法: 1.通过谷歌的Gson来进行解析: json数据:sTotalString = { ...

  9. linux中查看文件指定行的数据

    http://jingyan.baidu.com/article/15622f24125872fdfdbea560.html

  10. sqlite3接口简要说明

    本文介绍一下SQLite C/C++接口. 早期的SQLite C/C++接口只有5个接口函数, 很容易学习. 新版本的SQLite新增了很多功能, 目前大概有185个API接口.本文介绍一些核心的A ...