1. 程式人生 > >Mapped Statements collection does not contain value for 常見錯誤處理

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 
版權宣告:本文為博主原創文章,轉載請附上博文連結!