使用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. jquery 找到指定父级指定子集

    其中 closest() : jquery 1.3 新增 从元素本身开始,逐级向上级元素匹配,并返回最先匹配的元素. 其中 find() : 搜索所有与指定表达式匹配的元素.这个函数是找出正在处理的元 ...

  2. iframe调用页面中的局部部分

    iframe 调用网页,div遮挡展现局部. <div style=" width:iframe宽度; height:iframe高度; overflow:hidden "& ...

  3. log4j日志格式化

    Apache log4j 提供了各种布局对象,每一个对象都可以根据各种布局格式记录数据.另外,也可以创建一个布局对象格式化测井数据中的特定应用的方法. 所有的布局对象 - Appender对象收到 L ...

  4. 这 17 个 JVM 参数,高级 Java 必须掌握!

    作者:SimpleSmile https://www.cnblogs.com/Simple-Object/p/10272326.html前言 大家都知道,jvm在启动的时候,会执行默认的一些参数.一般 ...

  5. 都 9102 年了,一起来攻克 Linux 吧!

    都 9102 年了,一起来攻克 Linux 吧! 对 Java 程序员来说,天天会和 Linux 打交道,如果你无法熟练地操作 Linux ,基本上等于少了一半的功力,也少了一半的机会-- 身边的开发 ...

  6. 使用Pandas读取大型Excel文件

    import os import pandas as pd HERE = os.path.abspath(os.path.dirname(__file__)) DATA_DIR = os.path.a ...

  7. python-模块 time, os, sys

    时间模块 和时间有关系的我们就要用到时间模块.在使用模块之前,应该首先导入这个模块. #常用方法 1.time.sleep(secs) (线程)推迟指定的时间运行.单位为秒. 2.time.time( ...

  8. 在同一个项目中灵活运用application/json 和application/x-www-form-urlencoded 两种传输格式(配合axios,同时配置loading)

    'use strict' import axios from 'axios' // import qs from 'qs' import { Notification} from 'element-u ...

  9. ssh-keyscan - 收集 ssh 公钥

    总览 (SYNOPSIS) ssh-keyscan -words [-v46 ] [-p port ] [-T timeout ] [-t type ] [-f file ] [host | addr ...

  10. vue ui 开启无效记录

    换了台电脑,输入vue ui 无法开启图形化界面 1.首先vue ui 没成功 我找到vue.cmd路径配置到环境变量依旧没有解决 然后使用vue -h 显示没有vue ui这个命令 重新安装npm ...