0
点赞
收藏
分享

微信扫一扫

nested exception is org.apache.ibatis.exceptions.toomanyresultsexception: expected one result

勇敢的趙迦禾 2022-02-10 阅读 170

使用SpringBoot、mybatis框架日常小bug

org.mybatis.spring.MyBatisSystemException:

nested exception is org.apache.ibatis.exceptions.TooManyResultsException: Expected one result (or null) to be returned by selectOne(), but found: 8
 

出现此类错误表示你查询的sql查出来多条数据不能使用单个对象接受,需要使用集合接受数据。

Dao中

错误eg:PlywoodInfo 方法名(参数);

正确eg:List<PlywoodInfo> 名(参数);

PlywoodInfo是类名

举报

相关推荐

0 条评论