Mapped Statements collection does not contain value for 常见错误处理

大家在Mybatis使用过程中,尤其是初次接触使用会出现“Mapped Statements collection does not contain value for(后面是什么类什么方法之类的)“错误提示

常见的错误原因有几种:
1、mapper.xml中没有加入namespace

      

2、mapper.xml中的方法和接口mapper的方法不对应

3、mapper.xml没有加入到mybatis-config.xml中(即总的配置文件),例外:配置了mapper文件的包路径的除外

4、mapper.xml文件名和所写的mapper名称不相同。
--------------------- 
作者:ReStartForTD 
来源:CSDN 
原文:https://blog.csdn.net/wjb_2016/article/details/51768205 
版权声明:本文为博主原创文章,转载请附上博文链接!

猜你喜欢

转载自blog.csdn.net/fjnpysh/article/details/83178063