您现在的位置是:首页 > 其他 > 音视频开发音视频开发

错误:org.apache.ibatis.builder.BuilderException: Ambiguous collection type for property ‘children‘.

2021-06-07 20:59:22音视频开发人已围观

简介写了一个多表查询功能后,项目报错:Caused by: org.apache.ibatis.builder.BuilderException: Ambiguous collection type for property 'children'. You must specify 'javaType' or 'resultMap'. at org.apache.ibatis.builder.xml.XMLMapperBuilder.validateCollection(XMLMapperBuil

写了一个多表查询功能后,项目报错:

Caused by: org.apache.ibatis.builder.BuilderException: Ambiguous collection type for property 'children'. You must specify 'javaType' or 'resultMap'.
	at org.apache.ibatis.builder.xml.XMLMapperBuilder.validateCollection(XMLMapperBuilder.java:415)
	at org.apache.ibatis.builder.xml.XMLMapperBuilder.processNestedResultMappings(XMLMapperBuilder.java:401)
	at org.apache.ibatis.builder.xml.XMLMapperBuilder.buildResultMappingFromContext(XMLMapperBuilder.java:383)
	at org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElement(XMLMapperBuilder.java:280)
	at org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElement(XMLMapperBuilder.java:253)
	at org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElements(XMLMapperBuilder.java:245)
	at org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:118)
	... 77 common frames omitted

注意:Mapper.xml文件中 resultMap的Type类型和方法的返回值是否相同。
Mapper接口:

List<SubjectVo> selectNestedList();

错误写法:

 <resultMap id="selectNestedListMap" type="com.jie.car.service.edu.entity.Subject">

修改为:

 <resultMap id="selectNestedListMap" type="com.jie.car.service.edu.entity.Vo.SubjectVo">

文章来源:https://blog.csdn.net/weixin_45149712/article/details/117594443

Tags:java spring 

很赞哦! ()

随机图文

文章评论

留言与评论(共有 0 条评论)
   
验证码:

本栏推荐

站点信息

  • 文章统计247968篇文章
  • 浏览统计18356次浏览
  • 评论统计1个评论
  • 标签管理标签云
  • 统计数据:统计代码
  • 微信公众号:扫描二维码,关注我们