Mybatis的Update不能返回影响输数吗

J2EE 码拜 8年前 (2016-09-20) 2068次浏览
弱弱的问一句,Mybatis的Update不能返回影响输数吗?
假如给resultType赋值,会返回null,实际是有更新一条数据
请解释。
Mybatis的Update不能返回影响输数吗
解决方案

5

getSqlMapClientTemplate().update配置文件里没有,可是这个业务类是有返回值的。

10

不用配置 resultType.
默认调用就会返回的。
参考

10

<update id=”updateHome” parameterType=”home”>
update home set homeName=#{homeName},homeAddress=#{homeAddress},homePrice=#{homePrice}
where homeId=#{homeId}
</update>
id是方法名字 parameterType是参数

10

不需要配置update和delete,insert的返回类型,默认返回int
<update id=”update” parameterType=”string”>
对应的mapper
public int update(String);

5

引用:

不需要配置update和delete,insert的返回类型,默认返回int
<update id=”update” parameterType=”string”>
对应的mapper
public int update(String);

求帮助 http://bbs.csdn.net/topics/390797939?page=1#post-397461517


CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明Mybatis的Update不能返回影响输数吗
喜欢 (0)
[1034331897@qq.com]
分享 (0)