慕粉1319892
2020-04-23 22:36
Invalid bound statement (not found): com.example.mubatis_plus.mapper.UserMapper.selectAll
问题解决:pom添加
<build>
<resources>
<resource>
<!-- 描述存放资源的目录,该路径相对POM路径-->
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
问题解决了就好。一般是要添加如下配置,不然有的ide不会将写在src/main/java中的xml文件编译或打包到编译后的程序或者包中。
<resources> <resource> <directory>src/main/java</directory> <includes> <include>**/*.xml</include> </includes> </resource> </resources>
按照课堂上的,是配置在application.yml文件中
mybatis-plus: mapper-locations: classpath:mappers/*Mapper.xml
MyBatis-Plus入门
56140 学习 · 381 问题
相似问题
回答 1