mybatis错误 Mapped Statements collection does not contain value for

出现这个错误有网上说的:命名空间没写对,如果使用mapper,则 <mapper namespace="com.sitech.mapper.StudentMapper"> 空间中一定要写上Mapper的名称,否则就会报错。

java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.**.bank.dao.AmountMapper.selectQueryAccount

出现这个错误有网上说的:命名空间没写对,如果使用mapper,则 <mapper namespace="com.sitech.mapper.StudentMapper"> 空间中一定要写上Mapper的名称,否则就会报错。

还有一个情况就是interface的名称和你xml的名称没有一致造成的,我是这种情况,新手开发。。。

比如你mapper的名称为AmountMapper 但是xml的名称为AmountMapper_sqlMap.xml这个是ibatis2的惯用写法。。。囧

原文链接

mybatis错误 Mapped Statements collection does not contain value for