错误:org.apache.ibatis.builder.BuilderException: Ambiguous collection type for property ‘children‘.
程序员文章站
2022-07-15 13:08:51
...
写了一个多表查询功能后,项目报错:
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">
上一篇: 〖EXP〗Windows提权CVE-2020-0787修改版WebShell可用
下一篇: configure: error: cannot guess build type; you must specify one
推荐阅读
-
Ambiguous collection type for property ‘ ‘. You must specify ‘javaType‘ or ‘resultMap‘解决方案
-
记录一次:Ambiguous collection type for property ‘ adds‘. You must specify ‘javaType‘ or ‘resultMap‘.错误;
-
Ambiguous collection type for property ‘DrugInfos‘. You must specify ‘javaType‘ or ‘resultMap‘.
-
错误:org.apache.ibatis.builder.BuilderException: Ambiguous collection type for property ‘children‘.
-
Mybatis Ambiguous collection type for property ‘xxx‘. You must specify ‘java Type‘ or ‘resultMap‘.
-
Mybatis Ambiguous collection type for property ‘xxx‘. You must specify ‘java Type‘ or ‘resultMap‘.
-
Mybatis Ambiguous collection type for property ‘xxx‘. You must specify ‘java Type‘ or ‘resultMap‘.