Skip to content

Commit

Permalink
style format
Browse files Browse the repository at this point in the history
  • Loading branch information
huayanYu committed Aug 11, 2023
1 parent d9f2bd0 commit bc747fa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/
package com.baomidou.dynamic.datasource.aop;

import com.baomidou.dynamic.datasource.processor.DsProcessor;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.dynamic.datasource.processor.DsProcessor;
import com.baomidou.dynamic.datasource.support.DataSourceClassResolver;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import org.aopalliance.intercept.MethodInterceptor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,16 @@
@Slf4j
public class DataSourceClassResolver {

/**
* 默认事务属性
*/
private static final TransactionalInfo NULL_TRANSACTION_ATTRIBUTE = new TransactionalInfo() {
@Override
public String toString() {
return "null";
}
};
private static boolean mpEnabled = false;

private static Field mapperInterfaceField;

static {
Expand All @@ -64,7 +72,7 @@ public class DataSourceClassResolver {
mapperInterfaceField.setAccessible(true);
mpEnabled = true;
} catch (NoSuchFieldException e) {
e.printStackTrace();
log.warn("Failed to init mybatis-plus support.");
}
}
}
Expand All @@ -78,15 +86,6 @@ public class DataSourceClassResolver {
*/
private final Map<Object, TransactionalInfo> dsTransactionalCache = new ConcurrentHashMap<>();
private final boolean allowedPublicOnly;
/**
* 默认事务属性
*/
private static final TransactionalInfo NULL_TRANSACTION_ATTRIBUTE = new TransactionalInfo() {
@Override
public String toString() {
return "null";
}
};

/**
* 加入扩展, 给外部一个修改aop条件的机会
Expand Down Expand Up @@ -289,4 +288,4 @@ private <T> BasicAttribute<T> findDataSourceAttribute(AnnotatedElement ae, Class
}
return null;
}
}
}

0 comments on commit bc747fa

Please sign in to comment.