三月 08, 2017 2:30:16 下午 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet [SpringMVC] in context with path [/flip] threw exception [Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.TooManyResultsException: Expected one result (or null) to be returned by selectOne(), but found: 4] with root cause
org.apache.ibatis.exceptions.TooManyResultsEx
ception: Expected one result (or null) to be returned by selectOne(), but found: 4
原来是我写的查询数据库得到一个对象的方法,结果数据库里面有多个符合我查询条件的对象,所以报错了。
解决方法一:把数据库多条相同数据删除,
解决方法二:把方法改成集合方法
转载请注明原文地址: https://ju.6miu.com/read-2283.html