在mybatis搭建时出现错误:Mapper method attempted to return null from a method with a primitive return type (int)
错误提示为:
org.apache.ibatis.binding.BindingException: Mapper method 'com.mybatis.mapper.UserMapper.insertUser attempted to return null from a method with a primitive return type (int).
在映射文件中发现:
改为:
代码即可运行成功
<delete>.<update>均可适用
增删改中均不用添加resultType="int",不需返回值