标签:unicode 二级缓存 dep pass 对象 bat name 缓存 ali
1 。添加依赖
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>1.1.0</version>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.3</version>
</dependency>
2。配置文件
datasource:
type: com.alibaba.druid.pool.DruidDataSource # 配置当前要使用的数据源的操作类型
driver-class-name: oracle.jdbc.OracleDriver
password: Liangb1234
url: jdbc:oracle:thin:@127.0.0.1:1521:ORCL
username: scott
# 初始化大小,最小,最大
initialSize: 5
minIdle: 5
maxActive: 50
# 配置获取连接等待超时的时间
maxWait: 60000
mybatis:
config-location: classpath:mybatis/mybatis.cfg.xml # mybatis主配置文件所在路径
type-aliases-package: com.glodon.pcop.businessDataCollection.model # 定义所有操作类的别名所在包
mapper-locations: classpath:mybatis/mapper/*.xml
mybatis.cfg.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<!-- 进行mybatis的相应的环境的属性定义 -->
<settings>
<!-- 在本项目中开启二级缓存 -->
<setting name="cacheEnabled" value="true"/>
</settings>
</configuration>
3.启动类加扫描注解
@MapperScan("com.glodon.pcop.businessDataCollection.dao")
4 使用逆向工程生成对象
标签:unicode 二级缓存 dep pass 对象 bat name 缓存 ali
原文地址:https://www.cnblogs.com/liangb/p/12011760.html