org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.executor.ExecutorException: Statement returned more than one row, where no more than one was expected.
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:75) ~[MyBatisExceptionTranslator.class:1.2.2]
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:371) ~[SqlSessionTemplate$SqlSessionInterceptor.class:1.2.2]
Caused by: org.apache.ibatis.executor.ExecutorException: Statement returned more than one row, where no more than one was expected.
at org.apache.ibatis.executor.ResultExtractor.extractObjectFromList(ResultExtractor.java:58) ~[ResultExtractor.class:3.2.8]
at org.apache.ibatis.executor.loader.ResultLoader.loadResult(ResultLoader.java:71) ~[ResultLoader.class:3.2.8]
由於查找出了多個對象,一般查找的那個字段是數據有重復。
程序期望返回不超過一行數據,但實際返回了多於一行的數據。
比如sql語句的返回類型是非集合類型,但返回了多行數據。