1,异常信息
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:
### Error updating database. Cause: java.lang.IllegalArgumentExceptionfindByIds is ambiguous in Mapped Statements collection (try using the full name including the namespace, or rename one of the entries)
2,解决方法,id冲突,调用处用mapper namespace+sql名称:"全名 getSqlSession().selectList("com.xx.yy.findByIds")而不是etSqlSession().selectList("findByIds")
<select id="findByIds"。。。。。。

本文介绍了在使用MyBatis框架时遇到的ID冲突问题及其解决方案。主要原因是多个Mapper文件中定义了相同ID的方法,导致在执行时发生冲突。文章详细解释了解决这一问题的方法,即通过指定完整的命名空间来明确区分不同的Mapper方法。
2139

被折叠的 条评论
为什么被折叠?



