SpringBoot整合mybatis的配置问题
- pom.xml的配置
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>1.3.1</version>
</dependency>
- application.properties的配置
# 配置 MyBatis
# classpath 代表resources 目录下,classpath* 代表多目录下搜索
mybatis.mapper-locations: classpath:mapper/*.xml
# 全局的映射,不用在xml文件写实体类的全路径
mybatis.type-aliases-package: cn.zhku.lostandfound.entity
tips:
运行项目出现以下问题很有可能就是上面的xml目录没设置好
Invalid bound statement (not found) : 某某Mapper的方法