mybatis bug之resultmap缺少object-relation匹配参数password,造成设置密码不成功
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,造成设置密码不成功的更多相关文章
- 解决 Mybatis 元素类型为 "resultMap" 的内容必须匹配 "(constructor?,id*,result*,association*,collection*,discriminat
在配置 mybatis mapper.xml文件时, 一不小心就会报如下类似的异常: Caused by: org.springframework.beans.factory.BeanCreation ...
- ORM(Object/Relation Mapping)框架简介
ORM 框架简介 对象-关系映射(Object/Relation Mapping,简称ORM),是随着面向对象的软件开发方法发展而产生的.面向对象的开发方法是当今企业级应用开发环境中的主流开发方法,关 ...
- Mybatis映射文件中#取值时指定参数相关规则
Mybatis映射文件中#取值时指定参数相关规则 在#{}中,除了需要的数值外,还可以规定参数的一些其他规则. 例如:javaType,jdbcType,mode(存储过程),numericScale ...
- wx.navigateBack(OBJECT)怎么携带参数呢?
wx.navigateBack(OBJECT) 关闭当前页面,返回上一页面或多级页面.可通过 getCurrentPages() 获取当前的页面栈,决定需要返回几层. OBJECT 参数说明: 参数 ...
- swagger 接口文档,控制器 和 object类型的参数与返回值 的 注释不显示问题
一.控制器的注释不显示:是因为配置swagger的时候没有将includeControllerXmlComments参数配置为true,因为其默认值为false 二.object 类型的参数和返回值 ...
- mybatis+mysql返回插入的主键,参数只是提供部分参数
mybatis+mysql返回插入的主键,参数只是提供部分参数 <insert id="insertByChannelIdOpenid" useGeneratedKeys=& ...
- spring和mybatis整合时Access denied for user '***'@'localhost' (using password: YES)错误的解决方案
参考文章:博客园文章 参考解决办法: 将数据库配置文件格式 key=value 改为 jdbc.key=value 以下为问题分析 使用Spring + Mybatis + Mysql整合时,测试报错 ...
- 错误Mybatis 元素类型为 "resultMap" 的内容必须匹配 "(constructor?,id*,result*,association*,collection*,discriminat
今天算是见识了什么事顺序的重要性. 在使用mybatis时由于联合了其他的表,用到了resultMap,之后外加association这一项.可是在替换对应字段的位置上加上association总是报 ...
- Mybatis 元素类型为 "resultMap" 的内容必须匹配 "(constructor?,id*,result*,association*,collection*,discriminat
<resultMap id="BaseResultMap" type="com.youotech.tl_cons_credit_rating.entity.TL_C ...
随机推荐
- call、apply/bind的区别和用法(简单粗暴的解释)
var obj1={ name:"bob", age:20 } var obj2={ name:"coco", age:22 } function getAge ...
- 梅沙教育APP简单分析-版本:iOS v1.2.21-Nathaneko-佳钦
梅沙教育APP简单分析 时间:2017年6月6日 版本:iOS v1.2.21 分析人:Nathaneko-佳钦 备注:仅仅是个人一些简单的分析与见解,非正式产品分析报告,未体验购买相关功能,可能存在 ...
- C#根據當前DataGridView查詢數據導出Excel
private void btnsuggestinfo_Click(object sender, EventArgs e) { DataTable dt = new DataTable(); dt.C ...
- vue2.0学习——使用webstorm创建一个vue项目
https://blog.csdn.net/weixin_40877388/article/details/80911934
- CAD参数绘制直径标注(com接口)
主要用到函数说明: _DMxDrawX::DrawDimDiametric 绘制一个直径标注.详细说明如下: 参数 说明 DOUBLE dChordPointX 在被标注的曲线上的第一个点X值 DOU ...
- 使用nsight调试caffe
首先你需要下载caffe源码,然后先编译好,注意一定要将Makefile.config里的DEBUG := 1注释掉 可以看到注释掉debug后编译会生成的.build_debug目录,调试过程中需要 ...
- java自动机器人自动生成修姓名工具类
public class GenerateName { public static String getName() { Random random = new Random(); String[] ...
- C#语言中循环分类总结
C#语言中,循环主要分为4种,分别是:while循环.do while循环.for循环.foeach循环.下面我将分类对循环语句总结. 1.while循环: 如果循环条件为真,则执行循环体:执行完循环 ...
- ERC20 Token
pragma solidity ^0.4.8; contract Token{ // token总量,默认会为public变量生成一个getter函数接口,名称为totalSupply(). uint ...
- KBE_那些事
批处理文件不要放在工具栏执行,这里有坑:工具栏运行批处理文件,当前路径(%cd%)不是批处理文件所在路径 日志的输出(DEBUG_MSG 和 INFO_MSG)都被输出在({资产库}/logs/*.l ...