类 DynamicDatasourceNamedInterceptor
- java.lang.Object
-
- com.baomidou.dynamic.datasource.aop.DynamicDatasourceNamedInterceptor
-
- 所有已实现的接口:
org.aopalliance.aop.Advice
,org.aopalliance.intercept.Interceptor
,org.aopalliance.intercept.MethodInterceptor
public class DynamicDatasourceNamedInterceptor extends Object implements org.aopalliance.intercept.MethodInterceptor
Named Interceptor of Dynamic Datasource- 从以下版本开始:
- 3.4.0
- 作者:
- TaoYu
-
-
构造器概要
构造器 构造器 说明 DynamicDatasourceNamedInterceptor(DsProcessor dsProcessor)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
addPattern(String methodName, String dsKey)
add Item Patternvoid
addPatternMap(Map<String,String> map)
add PatternMapvoid
fromProperties(Properties properties)
config from propertiesObject
invoke(org.aopalliance.intercept.MethodInvocation invocation)
-
-
-
构造器详细资料
-
DynamicDatasourceNamedInterceptor
public DynamicDatasourceNamedInterceptor(DsProcessor dsProcessor)
-
-
方法详细资料
-
invoke
@Nullable public Object invoke(@Nonnull org.aopalliance.intercept.MethodInvocation invocation) throws Throwable
- 指定者:
invoke
在接口中org.aopalliance.intercept.MethodInterceptor
- 抛出:
Throwable
-
addPattern
public void addPattern(@Nonnull String methodName, @Nonnull String dsKey)
add Item Pattern- 参数:
methodName
- like select*dsKey
- like master or slave
-
fromProperties
public void fromProperties(@Nonnull Properties properties)
config from propertiesProperties attributes = new Properties(); attributes.setProperty("select*", "slave"); attributes.setProperty("add*", "master"); attributes.setProperty("update*", "master"); attributes.setProperty("delete*", "master");
- 参数:
properties
- ds properties
-
-