Mybatis报错: Mapped Statements collection already contains value for xxx
程序员文章站
2022-03-08 15:57:53
...
具体报错如下:
Caused by: java.lang.IllegalArgumentException: Mapped Statements collection already contains value for onion.dao.contentcheck.ClassAnnouncationDao.selectCount
at org.apache.ibatis.session.Configuration$StrictMap.put(Configuration.java:657)
at org.apache.ibatis.session.Configuration$StrictMap.put(Configuration.java:629)
at org.apache.ibatis.session.Configuration.addMappedStatement(Configuration.java:462)
at org.apache.ibatis.builder.MapperBuilderAssistant.addMappedStatement(MapperBuilderAssistant.java:296)
at org.apache.ibatis.builder.xml.XMLStatementBuilder.parseStatementNode(XMLStatementBuilder.java:113)
at org.apache.ibatis.builder.xml.XMLMapperBuilder.buildStatementFromContext(XMLMapperBuilder.java:128)
at org.apache.ibatis.builder.xml.XMLMapperBuilder.buildStatementFromContext(XMLMapperBuilder.java:121)
at org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:111)
... 67 more
产生原因:Mapper.xml文件所采用的SQL语句映射通过语句的ID进行区分,不仅仅是同一Mapper文件内语句ID不相同,所有配置内的Mapper文件内不能存在相同的语句ID,修改其中之一就行了
推荐阅读
-
使用mybatis报错【Result Maps collection already contains value for ...BaseResultMap】的解决方法
-
moven 部署Sping与mybatis时,Mapped Statements collection does not contain value for Xxxxxxxx
-
解决:Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for xxx
-
Mapped Statements collection already contains value for xxx
-
Mybatis:Mapped Statements collection does not contain value for
-
Mapped Statements collection does not contain value for XXX
-
Mapped Statements collection does not contain value for xxx
-
[email protected]使用报错:Mapped Statements collection does not contain value for XXX
-
mybatis错误 Mapped Statements collection does not contain value for
-
Mybatis报错—— Mapped Statements collection does not contain value for com.mapper.DepartmentMapper