当前位置:主页 > 软件编程 > JAVA代码 >

解决myBatis返回integer值的问题

时间:2021-05-04 10:48:35 | 栏目:JAVA代码 | 点击:

经过测试

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();

您可能感兴趣的文章:

相关文章