Caused by: org.apache.ibatis.exceptions.TooManyResultsException: Expected one result (or null) to be

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

错误原因:

mybatis返回的数据类型是多条而dao层只要返回一个值或nul

1.检查dao层返回的数据类型和mybatis返回的数据类型是否一致

你可能感兴趣的:(mybatis)