软件编程
位置:首页>> 软件编程>> java编程>> 解决myBatis返回integer值的问题

解决myBatis返回integer值的问题

作者:xianmin_yan  发布时间:2022-07-23 18:17:38 

标签:myBatis,integer

经过测试

resultMap="java.lang.Integer"

改成

resultType="java.lang.Integer"

也可以解决问题~

补充知识:mybatis返回count(*)的整数值

1、mybatis中resultType定义为"java.lang.Integer"


<select id="selectNums" resultType="java.lang.Integer">
select count(*) from tableName
</select>

2、接口中返回值写成int,即可

int selectNums();

来源:https://blog.csdn.net/yzllz001/article/details/62887704

0
投稿

猜你喜欢

手机版 软件编程 asp之家 www.aspxhome.com