其他分享
首页 > 其他分享> > nested exception is org.apache.ibatis.exceptions.toomanyresultsexception: expected one result

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

作者:互联网

使用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是类名

标签:exception,eg,nested,ibatis,result,mybatis,org
来源: https://blog.csdn.net/weixin_56683442/article/details/122865414