首页 > 编程语言 > 详细

springboot + mybatis 整合时 新增一条记录 遇到的错误

时间:2019-02-07 19:33:13      阅读:406      评论:0      收藏:0      [点我收藏+]

1. Mapper method ‘com.example.demo.mapper.userMapper.create attempted to return null from a method with a primitive return type (int).] with root cause

是新增用户信息接口,发现用户信息已经成功插入数据库,但是页面提示

There was an unexpected error (type=Internal Server Error, status=500).
Mapper method ‘com.example.demo.mapper.userMapper.create attempted to return null from a method with a primitive return type (int).
 
技术分享图片

出错原因很简单,mapper.xml 映射文件中,新增记录应该用insert,我懒,直接复制了上面的select, 然后搓了很久。。

springboot + mybatis 整合时 新增一条记录 遇到的错误

原文:https://www.cnblogs.com/qianjinyan/p/10355250.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!