mybatics异常org.apache.ibatis.exceptions.TooManyResultsException: Expected one result (or null) to be returned by selectOne(), but found: 5

遍历结果集1-n的时候出现

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

这个异常;

我的问题是在数据库之中,主键表和外键表的的列名相同,不能够同时遍历,得到的结果不能够存放人自己设置的

mapresult之中会出现得到多个结果的mapresult

只需要把两个表的列名修改一下,让它们不相同就可以了

posted @ 2018-09-13 23:18  谁在逆水行舟  阅读(1403)  评论(0编辑  收藏  举报