这个错误的表示方法返回了一个空值,在网上查找原因几乎都是这个问题:

在mapper的映射文件中,你要放回的结果类型resultType=int,int是不接收空值的,所以应该改成他的包装类。如果你查询语句需要返回一个对象,那么你的结果类型应该也得返回一个对象,对象名就是表名对应的实体类名字

但是我的原因明显不是这个,我用这个方法还是解决不了。我的原因是:

在查询语句中,要查询的是time_in ,这个在我的数据库中数据类型是date,所以在返回值类型中不可以使用int来接收,只能使用java.util.Date。

在映射文件中修改了返回值类型,那么在mapper文件中也需要修改返回类型才可以

修改后代码:

mapper method ......attempted to return null from.....相关推荐

  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 (int)错误 本 ...

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

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

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

  5. Mapper method attempted to return null from a method

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

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

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

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

  9. attempted to return null from a method with a primitive return type (int).

    错误产生的场景 dao层接口如下 int getResourceDataNumsByTitle(String title); mapper.xml 中sql语句如下 <select id=&qu ...

最新文章

  1. oracle查询数据库启动时的参数文件,【Oracle】数据库启动阶段参数文件、控制文件的问题处理...
  2. amt630a芯片中文资料_甲基化芯片学习记录
  3. 使用TensorFlow进行深度学习-第2部分
  4. 使用JDBC连接数据库(MySQL)的源代码
  5. 日常问题——VMware下的CentOS7 Ping不通百度
  6. 经典面试题:用typeof来判断对象的潜在陷阱
  7. 每天阅读一个 npm 模块(4)- throttle-debounce
  8. 身边的同学突然去世,听到消息的时候会伤心吗?
  9. 使用阿里云镜像仓库构建国外 Docker 镜像
  10. 第二章随机过程的基本知识part I
  11. QT学习之自定义控件
  12. 计算机显卡驱动停止工作,win7出现显卡器驱动程序已停止响应怎么办
  13. 软件著作权登记申请容易通过吗?软著申请成功率高吗?
  14. c语言结构体的流程图怎么画,结构流程图不会画?手把手教你学会!
  15. 知识图谱简介(一)——相关概念
  16. 服务器2008r2启动修复,Windows Server 2008 R2原生启动试用
  17. Xshell 6链接Liunx链接不上:
  18. css 比较好看的字体
  19. 洛谷P3374 树状数组模版1
  20. 光猫、交换机、路由器三者的区别在哪里?如何选择?

热门文章

  1. (图文)自己组建自己迷你linux系统
  2. Lesson258 - 单调队列
  3. 腾讯会议如何退款,如何重新购买
  4. 网口的标准POE供电
  5. mysql 内联函数_内联函数 - freeboy小亮 - 博客园
  6. linux socket结构,Linux C socket编程中几个常见的结构体定义
  7. 【精】LintCode领扣算法问题答案:1029. 寻找最便宜的航行旅途(最多经过k个中转站)
  8. vscode在html看到图片的插件_PPT做得又慢又丑?低调分享3款PPT辅助插件,轻松制作炫酷PPT...
  9. 计算机音乐简单好听,电脑上好听的歌怎么录制,教你2分钟,截取你爱听的声音...
  10. 屏蔽百度广告,百度新闻