问题:springboot+mybatisplus 项目,查询的时候报:
attempted to return null from a method with a primitive return type。
问题分析:后台sql未查询出数据,导致返回的内容与接口中的入参类型不一致,报错。
解决方案:修改相应接口的返回类型为包装类。
https://blog.youkuaiyun.com/weixin_42857099/article/details/85109177
本文介绍了在使用SpringBoot与MybatisPlus开发中遇到的查询返回null引发的错误,重点讲解了如何通过修改接口返回类型为包装类来解决这个问题,并提供了相关博客链接作为参考。
问题:springboot+mybatisplus 项目,查询的时候报:
attempted to return null from a method with a primitive return type。
问题分析:后台sql未查询出数据,导致返回的内容与接口中的入参类型不一致,报错。
解决方案:修改相应接口的返回类型为包装类。
https://blog.youkuaiyun.com/weixin_42857099/article/details/85109177
5460
620
5万+
284
3909
318
3912
1万+
1606
693
1261
674
6134

被折叠的 条评论
为什么被折叠?