mybatis : Caused by: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.xx.dao.mapper.TestMapper.BaseResultMap
原创    Blackbird    发表于:2018-09-10 09:13:24
  阅读 :130   收藏   编辑
Caused by: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.xx.dao.mapper.TestMapper.BaseResultMap
	at org.apache.ibatis.session.Configuration$StrictMap.put(Configuration.java:837)
	at org.apache.ibatis.session.Configuration$StrictMap.put(Configuration.java:809)
	at org.apache.ibatis.session.Configuration.addResultMap(Configuration.java:591)
	at org.apache.ibatis.builder.MapperBuilderAssistant.addResultMap(MapperBuilderAssistant.java:214)
	at org.apache.ibatis.builder.ResultMapResolver.resolve(ResultMapResolver.java:47)
	at org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElement(XMLMapperBuilder.java:285)
	at org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElement(XMLMapperBuilder.java:252)
	at org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElements(XMLMapperBuilder.java:244)
	at org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:116)
	... 56 more	

原因:在TestMapper.xml定义了相同的ID,如果ID重复,就会报这个错误


评论
条评论