mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-06 16:48:24 +08:00
fix: fix and close #ICLQQ3
This commit is contained in:
parent
97bf853364
commit
cc2ca249e0
@ -34,9 +34,11 @@ public class DataSourceKey {
|
||||
|
||||
public static void use(String dataSourceKey) {
|
||||
Deque<String> deque = lookup.get();
|
||||
if (deque != null) {
|
||||
deque.push(dataSourceKey);
|
||||
if (deque == null) {
|
||||
deque = new ArrayDeque<>(1);
|
||||
lookup.set(deque);
|
||||
}
|
||||
deque.push(dataSourceKey);
|
||||
}
|
||||
|
||||
public static String get() {
|
||||
@ -95,31 +97,4 @@ public class DataSourceKey {
|
||||
return shardingDsKey != null ? shardingDsKey : dataSource;
|
||||
}
|
||||
|
||||
// === For Removal ===
|
||||
|
||||
@Deprecated
|
||||
public static String getByManual() {
|
||||
throw new UnsupportedOperationException("使用 DataSource.get() 代替。");
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static String getByAnnotation() {
|
||||
throw new UnsupportedOperationException("使用 DataSource.get() 代替。");
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static void useWithAnnotation(String dataSourceKey) {
|
||||
throw new UnsupportedOperationException("使用 DataSource.use(String) 代替。");
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static void setAnnotationKeyThreadLocal(ThreadLocal<String> annotationKeyThreadLocal) {
|
||||
throw new UnsupportedOperationException("使用 DataSource.setThreadLocal(ThreadLocal<Deque<String>>) 代替。");
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static void setManualKeyThreadLocal(ThreadLocal<String> manualKeyThreadLocal) {
|
||||
throw new UnsupportedOperationException("使用 DataSource.setThreadLocal(ThreadLocal<Deque<String>>) 代替。");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user