public class DynamicDatasourceNamedInterceptor extends Object implements org.aopalliance.intercept.MethodInterceptor
| 构造器和说明 |
|---|
DynamicDatasourceNamedInterceptor(DsProcessor dsProcessor) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addPattern(String methodName,
String dsKey)
add Item Pattern
|
void |
addPatternMap(Map<String,String> map)
add PatternMap
|
void |
fromProperties(Properties properties)
config from properties
Properties attributes = new Properties();
attributes.setProperty("select*", "slave");
attributes.setProperty("add*", "master");
attributes.setProperty("update*", "master");
attributes.setProperty("delete*", "master");
|
Object |
invoke(org.aopalliance.intercept.MethodInvocation invocation) |
public DynamicDatasourceNamedInterceptor(DsProcessor dsProcessor)
@Nullable public Object invoke(@Nonnull org.aopalliance.intercept.MethodInvocation invocation) throws Throwable
invoke 在接口中 org.aopalliance.intercept.MethodInterceptorThrowablepublic void addPattern(@Nonnull String methodName, @Nonnull String dsKey)
methodName - like select*dsKey - like master or slavepublic void fromProperties(@Nonnull Properties properties)
Properties attributes = new Properties();
attributes.setProperty("select*", "slave");
attributes.setProperty("add*", "master");
attributes.setProperty("update*", "master");
attributes.setProperty("delete*", "master");
properties - ds propertiesCopyright © 2018–2021 baomidou. All rights reserved.