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)相关推荐

  1. 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 ...

  2. 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 ...

  3. 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 ...

  4. 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 ...

  5. 关于mybatis的报错 attempted to return null from a method with a primitive return type (int)

    https://blog.csdn.net/kisscatforever/article/details/77801060 一.前言       在往常敲代码的时候没有留意过int和Integer的区 ...

  6. 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 ...

  7. 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). 解决 ...

  8. 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 ...

  9. Mapper method attempted to return null from a method

    org.apache.ibatis.binding.BindingException: Mapper method 'share.pmc.modular.ed.mapper.DeviceMapper. ...

最新文章

  1. php向页面中添加数据_PHP创建文件,并向文件中写入数据,覆盖,追加的实现代码...
  2. SAP Fiori :why my filter for category does not work
  3. 别太贪婪,这些技能能让你一辈子满足
  4. SpringCloud stream连接RabbitMQ收发信息
  5. CardLayout使用
  6. python游戏编程入门下载-Python游戏编程入门 中文pdf扫描版|网盘下载内附地址提取码|...
  7. asp Eval()函数的一些使用总结
  8. 一个游戏策划案(仅供参考)
  9. 远程迅雷linux,Ubuntu 14.04安装迅雷Xware过程笔记
  10. linux war 权限,Linux中mv重命名作用及打包war压缩文件及分配权限
  11. 工作量证明生态的现状与运行原理
  12. java对打字速度,java课程设计-- 打字速度测试程序
  13. fpga学习之vga驱动
  14. UI设计实用经验分享
  15. pip20恢复官方源出现bug:confirming the ssl certificate: HTTPSConnectionPool(host=‘pypi.org‘, port=443)
  16. 前端后端傻傻分不清楚,这里给你答案
  17. 数据库原理及应用(六)SQL Server关系数据库系统
  18. 深度推荐模型-DIN
  19. 2022-2028年全球管道监测系统收入年复合增长率CAGR为 3.8%
  20. G4L-硬盘对拷工具

热门文章

  1. 对于有大量重复数据的表添加唯一索引
  2. Windows同一局域网如何文件共享
  3. 下载神器 Proxyee Down windows10 安装教程
  4. ev3编程 越野机器人_Lego ev3机器人怎么编程
  5. 怎么把avi转换成mp4?
  6. 责任链模式在SpringAOP中的使用
  7. 洛谷P2404 Java解法
  8. 如何用python计算函数的值域_(完整版)求函数定义域及值域方法及典型题归纳
  9. [300iq Contest 1]简要题解
  10. 【时序】动态时间规整(DTW)算法原理及Python实现