编程那点事编程那点事

专注编程入门及提高
探究程序员职业规划之道!

Result Maps collection already contains value for ...BaseResultMap

具体错误提示

Caused by: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.codingwhy.mapper.TbOrderMapper.BaseResultMap
at org.apache.ibatis.session.Configuration$StrictMap.put(Configuration.java:782)
at org.apache.ibatis.session.Configuration$StrictMap.put(Configuration.java:754)
at org.apache.ibatis.session.Configuration.addResultMap(Configuration.java:536)
at org.apache.ibatis.builder.MapperBuilderAssistant.addResultMap(MapperBuilderAssistant.java:207)
at org.apache.ibatis.builder.ResultMapResolver.resolve(ResultMapResolver.java:47)
at org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElement(XMLMapperBuilder.java:284)
at org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElement(XMLMapperBuilder.java:251)
at org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElements(XMLMapperBuilder.java:243)
at org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:116)
... 228 more

根据提示是重复定义了,看了下代码确实这样的

195819123.png

解决方法大家可以看下本站的这篇文章:解决mybatis generator 生成mapper.xml时代码重复问题

未经允许不得转载: 技术文章 » Java编程 » Result Maps collection already contains value for ...BaseResultMap

专注编程入门及提高,探究程序员职业规划之道!