解决Caused by: java.lang.IllegalArgumentException: Result Maps collection does not contain value for c

Posted 何甜甜在吗

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了解决Caused by: java.lang.IllegalArgumentException: Result Maps collection does not contain value for c相关的知识,希望对你有一定的参考价值。

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的引用

 

以上是关于解决Caused by: java.lang.IllegalArgumentException: Result Maps collection does not contain value for c的主要内容,如果未能解决你的问题,请参考以下文章