错误:
### Error querying database. Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.zhbit.Dao.impl.StudentDaoImpl.getStudentById
### Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.zhbit.Dao.impl.StudentDaoImpl.getStudentById
出现此类错误主要有:
1.Mapper.xml namespace:接口名错误。或加l .xml
2.Mapper.xml中的方法和接口的mapping方法不对应
3.Mapper.xml没有加入mybatis-config.xml配置
4.Mapper.xml文件名和所写下的mapper名称不同
但是啊,我不是这个问题

selectone()方法里,应该是接口下的方法!!
MyBatis错误解析
本文分析了MyBatis中出现MappedStatements collection does not contain value错误的原因,并提供了排查思路,包括检查Mapper.xml命名空间、方法映射及配置等问题。
2111

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



