原文:org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.TooManyResultsException: Expected one result (or null) to be returned by selectOne(), but found: 3

异常的原因:需要一个或空参数,但是返回了 个参数。我的两张表是t article和t comment,其中t article一个属性是包含t comment,如List commentList,所以Article类的commentList是可以接受多个Comment实体类参数的,这里是映射没弄好,导致多个参数映射不到commentList里面,下面开始解决。 最近用springboot整合Myba ...

2021-10-28 19:43 0 843 推荐指数:

查看详情

 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM