具体查看文档https://shardingsphere.apache.org/index_zh.html
加入pom.xml依赖
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>sharding-jdbc-core</artifactId>
<version>${latest.release.version}</version>
</dependency>
TIP
- application.yml
- 1、配置分片策略,详见文档
- 2、允许一个实体对应多个表
spring:
main:
allow-bean-definition-overriding: true