| 程序包 | 说明 |
|---|---|
| com.mybatisflex.core.datasource |
多数据源功能。
|
| com.mybatisflex.core.datasource.processor |
动态数据源注解@UseDataSource 的扩展
|
| 类和说明 |
|---|
| DataSourceProcessor
动态数据源 @UseDataSource的value值解析处理器(如表达式解析取值等),使用时推荐使用 DelegatingDataSourceProcessor
DelegatingDataSourceProcessor 实例化
对动态数据源注解@UseDataSource 增强处理UseDataSource
使用区分Spring模式 和 非Spring模式,Spring模式下,代理处理逻辑 DataSourceInterceptorcom.mybatisflex.spring.datasource.DataSourceInterceptor 优先级高于 FlexMapperProxyFlexMapperProxy ;
所以Spring模式下仅 DataSourceInterceptor 生效(切面生效的前提下)。 |
| 类和说明 |
|---|
| DataSourceProcessor
动态数据源 @UseDataSource的value值解析处理器(如表达式解析取值等),使用时推荐使用 DelegatingDataSourceProcessor
DelegatingDataSourceProcessor 实例化
对动态数据源注解@UseDataSource 增强处理UseDataSource
使用区分Spring模式 和 非Spring模式,Spring模式下,代理处理逻辑 DataSourceInterceptorcom.mybatisflex.spring.datasource.DataSourceInterceptor 优先级高于 FlexMapperProxyFlexMapperProxy ;
所以Spring模式下仅 DataSourceInterceptor 生效(切面生效的前提下)。 |
| DelegatingDataSourceProcessor
DataSourceProcessor 委托扩展类,对 DataSourceProcessor 结构进行扩大和增强
如果多个实例化,建议通过 DelegatingDataSourceProcessor.with(多个解析处理器实例) 方式进行实例化。
|
Copyright © 2025. All rights reserved.