Mybatis:Mapper method attempted to return null from a method with a primitive return type (int)
Mybatis中 Mapper method attempted to return null from a method with a primitive return type (int)错误
本人是在进行插入操作的时候发生的错误,相应的删除和修改都是同样的道理
<select id="saveEmpInfo" resultType="int">INSERT INTO emp(eId,eName,did) VALUES(#{eId},#{eName},#{did})</select >
错误提示:
org.apache.ibatis.binding.BindingException: Mapper method 'com.xa.dao.EmpDaoMapper.saveEmpInfo attempted to return null from a method with a primitive return type (int).
正确写法:
<insert id="saveEmpInfo">INSERT INTO emp(eId,eName,did) VALUES(#{eId},#{eName},#{did})</insert>
原因分析
增加:<insert></insert>
删除:<delete></delete>
修改:<update></update>
查询:<select></select>
其中,增删改都不需要添加resultType="int"
效果:
修改前:
修改后:
修改日志:
由图可见:eId为16的员工信息发生了修改
Mybatis:Mapper method attempted to return null from a method with a primitive return type (int)相关推荐
- Mybatis异常错误:Mapper method attempted to return null from a method with a primitive return type (int)
在mybatis搭建时出现错误:Mapper method attempted to return null from a method with a primitive return type (i ...
- MyBatis异常报告: Mapper method ‘com.dao.UserMapper.insert attempted to return null from a method with ……
错误名称:Mapper method 'com.dao.UserMapper.insert attempted to return null from a method with a primitiv ...
- mybatis异常Mapper method attempted to return null from a method with a primitive re
org.apache.ibatis.binding.BindingException: Mapper method attempted to return null from a method wi ...
- Mybatis中的attempted to return null from a method with a primitive return type (int).异常
错误截图: org.apache.ibatis.binding.BindingException: Mapper method 'com.shop_demo.dao.AdminDAO.getAdmin ...
- 关于mybatis的报错 attempted to return null from a method with a primitive return type (int)
https://blog.csdn.net/kisscatforever/article/details/77801060 一.前言 在往常敲代码的时候没有留意过int和Integer的区 ...
- mapper method attempted to return null from a method with a primitive return type (int)
一.场景和背景 工具:mybatis + pgsql dao代码: int selectMaxAgeBySex(String sex); 查询性别是女生的最大年龄 sql: <select id ...
- sql报错解决方案:attempted to return null from a method with a primitive return type (int)
问题现象 idea执行查询数量语句控制台报错:attempted to return null from a method with a primitive return type (int). 解决 ...
- Mapper method ‘com.xxx.dao.ActivityDao.update attempted to return null from a method with a primiti
500异常报告: Mapper method 'com.xxx.dao.ActivityDao.update attempted to return null from a method with a ...
- Mapper method attempted to return null from a method
org.apache.ibatis.binding.BindingException: Mapper method 'share.pmc.modular.ed.mapper.DeviceMapper. ...
最新文章
- php向页面中添加数据_PHP创建文件,并向文件中写入数据,覆盖,追加的实现代码...
- SAP Fiori :why my filter for category does not work
- 别太贪婪,这些技能能让你一辈子满足
- SpringCloud stream连接RabbitMQ收发信息
- CardLayout使用
- python游戏编程入门下载-Python游戏编程入门 中文pdf扫描版|网盘下载内附地址提取码|...
- asp Eval()函数的一些使用总结
- 一个游戏策划案(仅供参考)
- 远程迅雷linux,Ubuntu 14.04安装迅雷Xware过程笔记
- linux war 权限,Linux中mv重命名作用及打包war压缩文件及分配权限
- 工作量证明生态的现状与运行原理
- java对打字速度,java课程设计-- 打字速度测试程序
- fpga学习之vga驱动
- UI设计实用经验分享
- pip20恢复官方源出现bug:confirming the ssl certificate: HTTPSConnectionPool(host=‘pypi.org‘, port=443)
- 前端后端傻傻分不清楚,这里给你答案
- 数据库原理及应用(六)SQL Server关系数据库系统
- 深度推荐模型-DIN
- 2022-2028年全球管道监测系统收入年复合增长率CAGR为 3.8%
- G4L-硬盘对拷工具