org.apache.ibatis.builder.IncompleteElementException: Could not find result map com.abc.beans.Minister
使用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的更多相关文章
- 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 ...
- 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 ...
- org.apache.ibatis.builder.IncompleteElementException: Could not find result map java.util.HashMap
这样的配置有问题吗? <select id="getFreightCollectManagementList" resultMap="java.util.HashM ...
- 【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 ...
- 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 ...
- MyBatis的mapper.xml文件的参数问题:org.apache.ibatis.builder.IncompleteElementException: Could not find parameter map
配置参数类型有两种选择,即:parameterType和parameterMap 不管参数是否是基本数据类型还是map类型,都是使用parameterType. 版权声明:本文为博主原创文章,未经博主 ...
- org.apache.ibatis.builder.IncompleteElementException: Could not find parameter map
mybatis 出现这个错误是 参数类型写错了.parameterType 写成了parameterMap
- [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 ...
- Mybatis报错:org.apache.ibatis.builder.IncompleteElementException
org.apache.ibatis.builder.IncompleteElementException: Could not find result map java.lang.Integer遇到这 ...
随机推荐
- Java学习之接口
接口作用:为类提供额外功能(方法) 一.接口定义 interface IDemo { ;//可以简写:int NUM=4; public abstract void show();//可以简写:voi ...
- processing模拟三角级数合成方波过程
代码 1: int radius = 2; 2: int[] accumys; 3: int times = 0; 4: 5: float scale = 1; 6: int origin = 400 ...
- 5.如何使用jmeter参数话
参数化:简单的来理解一下,我们录制了一个脚本,这个脚本中有登录操作,需要输入用户名和密码,假如系统不允许相同的用户名和密码同时登录,或者更好的模拟多个用户来登录系统.这个时候就需要对用户名和密码进行参 ...
- 几道JS代码手写面试题
几道JS代码手写面试题 (1) 高阶段函数实现AOP(面向切面编程) Function.prototype.before = function (beforefn) { let ...
- Android毕业四年升P8,年收入超100w,他是如何做到的?
很多人从事Android开发工作多年,走过的弯和坎,不计其数,经历的心酸难与外人道也.相信大家感触最深的还是:选择大于努力.选择正确的方向,才能够走的更远,更踏实. 今天我来分享一下自己心得体会,并没 ...
- 下载文件时HttpServletResponse设置响应头的Content-Disposition属性
Content-Disposition属性有两种类型 inline :将文件内容直接显示在页面 attachment:弹出对话框让用户下载 弹出对话框下载文件 resp.setHeader(" ...
- android中的原始资源的使用
原始资源可以放在两个地方: 1.位于/res/raw目录下,android SDK会处理该目录下的原始资源,android SDK会在R清单类中为该目录下的资源生成一个索引项. 2.位于/assets ...
- 服务bindService()方法启动服务
public class MainActivity extends Activity { private EditText studentno; private ServiceConnection c ...
- ASE19 团队项目 alpha 阶段 Frontend 组 scrum7 记录
本次会议于11月11日,11:30 在微软北京西二号楼13158,持续15分钟. 与会人员:Jingyi Xie, , Ziwei Wu, Jiaqi Xu, Jingwei Yi, Hanyue T ...
- 64位 __int 与 long long写法
在做ACM题时,经常都会遇到一些比较大的整数.而常用的内置整数类型常常显得太小了:其中long 和 int 范围是[-2^31,2^31),即-2147483648~2147483647.而unsig ...