1. 程式人生 > >MyBatis中出現Mapped Statements collection does not contain value

MyBatis中出現Mapped Statements collection does not contain value

1.確定xml檔案中<mapper namespace=""/>中的namespace是否路徑正確(在此案例中namespace與實際路徑一致),由於namespace不同會引發此問題

2.確定xml檔案的名稱是否與介面類的名稱保持一致,在上例中出現問題就是因為不小心將xml檔案命名為LendKPIDataMapper.xml,而介面檔案為:LeadKPIDataMapper.java。一字之差導致異常的發生。