使用mybatis进行一对多嵌套查询时出错,错误原因:

    <select id="findMinisterById" resultMap="com.abc.beans.Minister">
select mid,mname from minister where countryId = #{cid}
</select>
<resultMap id="AndSelectCountry" type="com.abc.beans.Country">
<id property="id" column="cid"/>
<result property="name" column="cname"/>
<collection property="minister"
column="cid"
ofType="com.abc.beans.Minister"
select="findMinisterById">
</collection>
</resultMap>
<select id="findById" resultMap="AndSelectCountry">
select cid,cname from country where cid = #{id}
</select>
</mapper>

java.lang.IllegalArgumentException: Result Maps collection does not contain value for xxxx.xxx
解决办法:
1.检查mybatis的xml配置
2.在某处肯定有配错了的,如"resultMap" -->“resultType”

像我这样的因为findMinisterById查询时,返回的是com.abc.beans.Minister类型,此时如果该实体类和对应的表属性值一致,就要把这个标红的resuitMap改为resultType

org.apache.ibatis.builder.IncompleteElementException: Could not find result map com.abc.beans.Minister的更多相关文章

  1. org.apache.ibatis.builder.IncompleteElementException: Could not find result map java.lang.Integer

    如图: 详细错误信息如下: org.apache.ibatis.builder.IncompleteElementException: Could not find result map java.l ...

  2. org.apache.ibatis.builder.IncompleteElementException: Could not find result map com.hp.entity.Emp

    错误提示代码: org.apache.ibatis.builder.IncompleteElementException: Could not find result map com.hp.entit ...

  3. org.apache.ibatis.builder.IncompleteElementException: Could not find result map java.util.HashMap

    这样的配置有问题吗? <select id="getFreightCollectManagementList" resultMap="java.util.HashM ...

  4. 【mybatis】mybatis方法访问报错:org.apache.ibatis.builder.IncompleteElementException: Could not find result map com.pisen.cloud.luna.ms.goods.base.domain.GoodsConfigQuery

    在调用mapper.xml中的方法的时候,报错: org.apache.ibatis.builder.IncompleteElementException: Could not find result ...

  5. org.apache.ibatis.builder.IncompleteElementException: Could not find parameter map com.hyzn.historicalRecord.dao.ITB_HISTORYLOGDAO.TB_HISTORYLOGResultMap

    用了很久的myBatis,忽然出现这个错误,感觉配置什么的都是正确的,错误如下: org.apache.ibatis.builder.IncompleteElementException: Could ...

  6. MyBatis的mapper.xml文件的参数问题:org.apache.ibatis.builder.IncompleteElementException: Could not find parameter map

    配置参数类型有两种选择,即:parameterType和parameterMap 不管参数是否是基本数据类型还是map类型,都是使用parameterType. 版权声明:本文为博主原创文章,未经博主 ...

  7. org.apache.ibatis.builder.IncompleteElementException: Could not find parameter map

    mybatis 出现这个错误是 参数类型写错了.parameterType 写成了parameterMap

  8. [springMVC - 1A] - Request processing failed; nested exception is org.apache.ibatis.builder.IncompleteElementException

    一月 14, 2016 1:30:07 下午 org.apache.catalina.core.StandardWrapperValve invoke严重: Servlet.service() for ...

  9. Mybatis报错:org.apache.ibatis.builder.IncompleteElementException

    org.apache.ibatis.builder.IncompleteElementException: Could not find result map java.lang.Integer遇到这 ...

随机推荐

  1. MySQL高级学习笔记(七):MySql主从复制

    文章目录 复制的基本原理 slave会从master读取binlog来进行数据同步 三步骤+原理图 复制的基本原则 复制的最大问题 一主一从常见配置 mysql版本一致且后台以服务运行(双方能够pin ...

  2. 【lua学习笔记】--- 数据类型

    print("hello world!") --[注释方法]-- 单行注释 对应C# //--[[ 多行注释 /* 对应C# */]]-- -- [数据类型]--1 nil 空值 ...

  3. PAT甲级——A1144 TheMissingNumber【20】

    Given N integers, you are supposed to find the smallest positive integer that is NOT in the given li ...

  4. windows 安装虚拟环境

    步骤一:安装virtualenv 在windows cmd终端下使用输入:pip install virtualenv 步骤二:新建虚拟环境 在cmd终端输入virtualenv testvir(环境 ...

  5. Jmeter命令行 传递参数

    二.参数 -J 和 -G 1.格式:-J变量名=值  -G变量名=值 2.相同之处:设置jmeter属性,例如线程数.循环次数.ramp up-time等 3.不同之处:-J是设置本地jmeter属性 ...

  6. Python django tests

    单元测试函数必须以test_开头,否则无法被识别

  7. pyhon if分支

    在python中,最常用的就是if判断,if判断可以分为单次判断和多次判断 单次判断 if   条件 : (条件成立执行我) else:(else也可以没有,最近的else对应最近的if语句) (条件 ...

  8. 后端大佬给我配置的deploy serves文件以便学习

    serves apiVersion: v1 kind: Service metadata: labels: com.wise2c.service: ui-ll-2 com.wise2c.stack: ...

  9. JSP界面引用百度地图获取坐标

    需求: 需要在JSP界面上引用百度地图,文本框中输入地址之后,自动拿到在百度地图上的经纬度 解决步骤: 1.引入百度地图api: head中进行引用<script type="text ...

  10. systemd-tmpfiles - Operation not permitted chown ; systemd-modules-load.service

    systemd-tmpfiles-setup.service  fail  一般为 /exports/rfs/var/lib/systemd/ 下的文件属性问题 , chown -R   root:r ...