300字范文,内容丰富有趣,生活中的好帮手!
300字范文 > Result Maps collection does not contain value for xxx

Result Maps collection does not contain value for xxx

时间:2019-03-16 23:08:11

相关推荐

Result Maps collection does not contain value for xxx

错误信息:结果com.jd.ecodd.param.concat.client.vo.QuerySceneTypeVo结果集不包含值

java.lang.IllegalArgumentException: Result Maps collection does not contain value for com.jd.ecodd.param.concat.client.vo.QuerySceneTypeVoat org.apache.ibatis.session.Configuration$StrictMap.get(Configuration.java:888)at org.apache.ibatis.session.Configuration.getResultMap(Configuration.java:640)at org.apache.ibatis.builder.MapperBuilderAssistant.getStatementResultMaps(MapperBuilderAssistant.java:344)at org.apache.ibatis.builder.MapperBuilderAssistant.addMappedStatement(MapperBuilderAssistant.java:290)at org.apache.ibatis.builder.xml.XMLStatementBuilder.parseStatementNode(XMLStatementBuilder.java:109)

错误原因:因为我在mapper.xml文件上面定义了resultMap:

<resultMap id="QuerySceneTypeVo" type="com.jd.ecodd.param.concat.client.vo.QuerySceneTypeVo"><result column="id" property="id"/><result column="source_type" property="sourceType"/><result column="source_type_code" property="sourceTypeCode"/></resultMap>

而我在下面写select方法的使用引用的非已经定义好的结果集,而引用的是原包:

<select id="get"parameterType="java.lang.String"resultMap="com.jd.ecodd.param.concat.client.vo.QuerySceneTypeVo">SELECT<include refid="baseColum"/>FROM t_tableName<where><if test="source!=null and source!=''">and source LIKE CONCAT ('%',#{source},'%')</if></where></select>

以上两种方式冲突,所以报了这个错误。

解决方法:使用其中一种返回方式就可以了。

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。