spring boot集成Mybatis
需求
spring boot 体系集成数据持久层框架,技术选型是mybatis
使用注解的方式编写SQL
版本
spring boot 2.1.3.RELEASE
mybatis-spring-boot-starter 2.0.0
集成步骤
**1 引入pom**
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.0.0</version>
</dependency>
2 配置数据库信息,yml形式的
spring:
datasource:
url:
driverClassName:
username:
password:
3 需要驼峰转换的规则,加入如下配置
mybatis:
configuration:
map-underscore-to-camel-case: true
还没有评论,来说两句吧...