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

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, 然后搓了很久。。

猜你喜欢

转载自www.cnblogs.com/qianjinyan/p/10355250.html
今日推荐