Mapped Statements collection already contains value for
程序员文章站
2022-07-15 12:06:04
...
- 报错信息
Caused by: java.lang.IllegalArgumentException: Mapped Statements collection already contains value for
- 原因
存在重复的方法名或statementID。
- 解决方法
检查dao类和xml文件,看是否存在相同的方法名和statementID,并修改之。
- 注意
持久层不能重载,因为接口调用的识别statementID的策略是命名空间和方法名两者,而非通过命名空间、方法名和参数三者来作为判断。
- 案例
xml错误
<insert id="programming">
</insert>
<insert id="programming">
</insert>
dao类错误
public void programming(@Param("name")String name,@Param("age")String age,@Param("studentId")String studentId);
public void programming(@Param("name")String name,@Param("age")String age,@Param("studentId")String studentId);
推荐阅读
-
使用mybatis报错【Result Maps collection already contains value for ...BaseResultMap】的解决方法
-
moven 部署Sping与mybatis时,Mapped Statements collection does not contain value for Xxxxxxxx
-
【Bug解决】org.apache.ibatis.type.TypeException: The alias ‘xxxx‘ is already mapped to the value ‘xxx‘
-
java.lang.IllegalArgumentException: Result Maps collection already contains value for
-
Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for ...
-
mybatis****Caused by: java.lang.IllegalArgumentException: Result Maps collection already contains va
-
java.lang.IllegalArgumentException: Result Maps collection already contains value for
-
Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for.....
-
解决:Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for xxx
-
Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for……