File tree Expand file tree Collapse file tree 5 files changed +6
-21
lines changed
dynamic-datasource-creator/src/main/java/com/baomidou/dynamic/datasource/creator/druid
dynamic-datasource-spring-boot-starter/src/test/java/com/baomidou/dynamic/datasource/fixture/v1
dynamic-datasource-spring-boot3-starter/src
main/java/com/baomidou/dynamic/datasource/spring/boot/autoconfigure
test/java/com/baomidou/dynamic/datasource/fixture/v3 Expand file tree Collapse file tree 5 files changed +6
-21
lines changed Original file line number Diff line number Diff line change @@ -41,10 +41,6 @@ dynamic-datasource-spring-boot-starter 是一个基于springboot的快速集成
4141
4242其支持 ** Jdk 1.7+, SpringBoot 1.5.x 2.x.x 3.x.x** 。
4343
44- ## 文档 | Documentation
45-
46- 详细文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/2264611
47-
4844## 贡献 | Contributing
4945
5046我们欢迎社区的贡献,请查看 [ CONTRIBUTING.md] ( ./CONTRIBUTING.md ) 。
@@ -72,14 +68,14 @@ dynamic-datasource-spring-boot-starter 是一个基于springboot的快速集成
72682 . 配置文件所有以下划线 ` _ ` 分割的数据源 ** 首部** 即为组的名称,相同组名称的数据源会放在一个组下。
73693 . 切换数据源可以是组名,也可以是具体数据源名称。组名则切换时采用负载均衡算法切换。
74704 . 默认的数据源名称为 ** master** ,你可以通过 ` spring.datasource.dynamic.primary ` 修改。
75- 5 . 方法上的注解优先于类上注解 。
76- 6 . DS支持继承抽象类上的DS,暂不支持继承接口上的DS 。
71+ 5 . 代码块里主动切换>方法上的注解优>类上注解(就近原则) 。
72+ 6 . DS支持继承抽象类上的DS,支持继承接口上的DS 。
7773
7874# 使用方法
7975
80- 1 . 引入dynamic -datasource-spring-boot-starter。
76+ 1 . 引入 ` dynamic -datasource-spring-boot-starter` 或者 ` dynamic-datasource-spring-boot3-starter ` 。
8177
82- spring-boot 1.5.x 2.x.x
78+ - spring-boot 1.5.x 2.x.x
8379
8480``` xml
8581
@@ -90,7 +86,7 @@ spring-boot 1.5.x 2.x.x
9086</dependency >
9187```
9288
93- spring-boot3及以上
89+ - spring-boot3及以上
9490
9591``` xml
9692
Original file line number Diff line number Diff line change 2525import java .beans .Introspector ;
2626import java .beans .PropertyDescriptor ;
2727import java .lang .reflect .Method ;
28- import java .util .ArrayList ;
29- import java .util .HashMap ;
30- import java .util .List ;
31- import java .util .Map ;
32- import java .util .Optional ;
33- import java .util .Properties ;
34- import java .util .Set ;
28+ import java .util .*;
3529
3630/**
3731 * Druid配置工具类
Original file line number Diff line number Diff line change 1919import com .baomidou .dynamic .datasource .creator .DataSourceProperty ;
2020import com .baomidou .dynamic .datasource .creator .DefaultDataSourceCreator ;
2121import com .baomidou .dynamic .datasource .fixture .v1 .service .tx .*;
22- import com .baomidou .dynamic .datasource .tx .TransactionContext ;
2322import org .junit .jupiter .api .Test ;
2423import org .springframework .beans .factory .annotation .Autowired ;
2524import org .springframework .boot .SpringApplication ;
2625import org .springframework .boot .autoconfigure .SpringBootApplication ;
2726import org .springframework .boot .test .context .SpringBootTest ;
28- import org .springframework .transaction .support .TransactionSynchronization ;
2927
3028import javax .sql .DataSource ;
3129import java .util .Arrays ;
Original file line number Diff line number Diff line change 2424import org .springframework .boot .autoconfigure .condition .ConditionalOnMissingBean ;
2525import org .springframework .boot .autoconfigure .condition .ConditionalOnProperty ;
2626import org .springframework .boot .autoconfigure .jdbc .DataSourceAutoConfiguration ;
27- import org .springframework .boot .context .properties .EnableConfigurationProperties ;
2827import org .springframework .context .annotation .Bean ;
2928import org .springframework .context .annotation .Configuration ;
3029import org .springframework .context .annotation .Import ;
Original file line number Diff line number Diff line change 1919import com .baomidou .dynamic .datasource .creator .DataSourceProperty ;
2020import com .baomidou .dynamic .datasource .creator .DefaultDataSourceCreator ;
2121import com .baomidou .dynamic .datasource .fixture .v3 .service .tx .*;
22- import com .baomidou .dynamic .datasource .tx .TransactionContext ;
2322import org .junit .jupiter .api .Test ;
2423import org .springframework .beans .factory .annotation .Autowired ;
2524import org .springframework .boot .SpringApplication ;
2625import org .springframework .boot .autoconfigure .SpringBootApplication ;
2726import org .springframework .boot .test .context .SpringBootTest ;
28- import org .springframework .transaction .support .TransactionSynchronization ;
2927
3028import javax .sql .DataSource ;
3129import java .util .Arrays ;
You can’t perform that action at this time.
0 commit comments