mybatis 入門練習項目報錯:
### Error updating database. Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for c***********ent
### Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for c***********ent
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:26)
at ………………
原因在於session執行的映射文件名錯誤,與映射文件中<mapper namespace="***********">不一樣
// Test.java
SqlSession session = factory.openSession();
session.insert("com.lee.dao.IStudentMapper.saveStudent"); // 映射文件路徑
<!-- StuMapper.xml -->
<mapper namespace="com.lee.dao.IStudentMapper">