mapper.xml文件不在resources中,扫描不到文件问题。
报错:Invalid bound statement (not found):
原因: mapper.xml文件不在resources中,导致IDEA扫描不 到.xml文件
// 绑定语句无效
报错:Invalid bound statement (not found): com.information.platform.dao.ColumnMapper.selectAll
在pom.xml中导入扫描位置路径。
<build>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
<build>
本文介绍当MyBatis遇到mapper.xml文件不在resources目录下导致无法正确扫描的情况时的解决方案。通过在pom.xml中配置资源路径,确保IDEA能够识别到这些文件。
274

被折叠的 条评论
为什么被折叠?



