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">
版权声明:本文为Li_TOPPPP原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。