Mapped Statements collection already contains value for xxx
程序员文章站
2022-07-15 12:05:34
...
Mapped Statements collection already contains value for com.zzu.ssm.mapper.UserMapper.findUserById
原因:
1.xml文件中有相同的id ,例如findUserById出现两次;
2.sqlSessionFactory 加载了两次相同的xml文件。
<mapper resource="mapper/UserMapper.xml" />
<mapper resource="UserMapper.xml" />