• mybatis中:returned more than one row, where no more than one was expected.异常


    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语句的返回类型是非集合类型,但返回了多行数据。

  • 相关阅读:
    Hdu 2564 单词缩写(字符串输入流的使用)
    Hdu2824 快速求欧拉函数和
    hdu 1787 欧拉函数模板
    Hdu2558(欧拉函数)
    hdu 1175连连看 (bfs带方向变化次数)
    pandas 使用总结
    APScheduler 定时任务使用总结
    watchdog 监控文件变化使用总结
    js 鼠标特效
    js 生成雪花间隔
  • 原文地址:https://www.cnblogs.com/simpledev/p/4253906.html
Copyright © 2020-2023  润新知