解决Caused by: java.lang.IllegalArgumentException: Result Maps collection does not contain value for com.geek.dao.ContentDao.Integer

时间:2022-05-09 12:57:35

mybatis报错:Caused by: java.lang.IllegalArgumentException: Result Maps collection does not contain value for com.geek.dao.ContentDao.Integer

出错原因:一个手误

  <select id="selectAllFirstNavigationName" resultMap="firstNavigation">
SELECT first_navigation_name
FROM first_navigation
</select>

修改方法:将resultMap修改为resultType,因为返回的是基本的数据类型

resultType和resultMap的区别:resultType是直接表示返回类型的,而resultMap则是对外部ResultMap的引用