这个问题在于你查询sql返回结果是多个值、一个集合,但是你在service的实现层的dao都调用了.get方法。而是应该使用.getlist方法等。

Expected one result (or null) to be returned by selectOne(), but found 2的更多相关文章

  1. Caused by: org.apache.ibatis.exceptions.TooManyResultsException: Expected one result (or null) to be returned by selectOne(), but found: 2

    异常信息 Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with na ...

  2. Expected one result (or null) to be returned by selectOne(), but found: 3

    Expected one result (or null) to be returned by selectOne(), but found: 3 返回应该是对象但是给的是list

  3. Expected one result (or null) to be returned by selectOne(), but found: 2 和 java.lang.UnsupportedOperationException异常

    在学习MyBatis的时候,简简单单的MyBatis+MySql的增删改查操作,但是却出了问题. 刚开始数据库只有一条数据的时候,岁月静好,一切看起来都那么的OJBK.但是,当我往数据库插入第二条数据 ...

  4. 测试环境部署之填坑记录-Expected one result (or null) to be returned by selectOne(), but found: 2

    最近在部署性能测试环境的时候,环境 部署好以后,部分功能出现接口查询异常,问题现象: 拿到错误,肯定要先判断是前端还是后端代码的问题,最简单的方式是抓包查看: 以上是报错页面捕获的接口报错,很明显的接 ...

  5. Expected one result (or null) to be returned by selectOne() 数据库结果集和java实例

    mybatis会根据查询的结果集初始化java实例. 如果是复杂类型,我们一般都会在mapper中做好映射. 1.所以如果查询到的是多个结果,那么对应的java类型也必须的集合类型.(result 为 ...

  6. 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报错解决

    报错的原因翻译出来: 预期的一个结果(或null)返回selectOne(),但发现:3 意思就是你想得到一个结果值,但是返回了三个结果值. 一般可能测试的时候我们存了几条一样的数据,在登录时,会把同 ...

  7. 【java异常】Expected one result (or null) to be returned by selectOne(), but found: 63

    OmQuotaTBBean omQuotaTBBean = mOmQuotaTBMapper.findOmQuotaTB(); 改成 List<OmQuotaTBBean> listOmQ ...

  8. 一个坑:java.sql.ResultSet.getInt==》the column value; if the value is SQL NULL, the value returned is 0

    Retrieves the value of the designated column in the current row of this ResultSet object as a String ...

  9. MyBatis入门基础(一)

    一:对原生态JDBC问题的总结 新项目要使用mybatis作为持久层框架,由于本人之前一直使用的Hibernate,对mybatis的用法实在欠缺,最近几天计划把mybatis学习一哈,特将学习笔记记 ...

随机推荐

  1. UDP/TCP

    转载地址http://blog.csdn.net/wwmusic/article/details/8875748 Socket  是一套建立在TCP/IP协议上的接口不是一个协议 应用层:  HTTP ...

  2. 3.2 ARM指令分类学习

    1 算术移位寄存器和逻辑指令 1.1 mov 传送(Move) Mov {条件} {S} <dest>, <op_1> MOV从另一个寄存器.被移位的寄存器.或者一个立即数装载 ...

  3. where 子句中使用通配符

    模糊匹配 ------------------------模糊匹配----------------- '[1-9]'.'[a-z]'.'[^4]' select * from student wher ...

  4. C# 访问MongoDB 通用方法类

    using MongoDB.Driver; using System; namespace MongoDBDemo { public class MongoDb { public MongoDb(st ...

  5. css3动画(@keyframes和animation的用法)

    animation基本用法是: animation: name keeping-time animate-function delay times iteration final; 第一个参数:nam ...

  6. Oracle11g导出空表

    # Oracle11g导出空表 <!-- create time: 2015-06-01 23:35:24 --> ###原因 11G中有个新特性,当表无数据时,不分配`segment`, ...

  7. Git--分布式版本控制系统

    使用Git实现多人协作开发 1.简述 每创建一个大的web项目都会有团队协作完成, 然这个过程有可能就像毕业生写论文的过程, 这个过程会有很多...修改的版本, 我们的项目也是会经过无休止的改需求, ...

  8. 监控数据库运行 - MS SQL 日常维护管理常用脚本(二)

    查看数据库登录名信息 use mastergoSELECT name AS LoginName , dbname AS DefaultDB , createdate AS CreateDate, up ...

  9. 自己用C语言写dsPIC / PIC24 serial bootloader

    了解更多关于bootloader 的C语言实现,请加我QQ: 1273623966 (验证信息请填 bootloader),欢迎咨询或定制bootloader(在线升级程序). HyperBootlo ...

  10. <读书笔记>软件调试之道 :从大局看调试-发现代码存在问题

    声明:本文档的内容主要来源于书籍<软件调试修炼之道>作者Paul Butcher,属于读书笔记.欢迎转载! ---------------------------------------- ...