mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-07 00:58:24 +08:00
This commit is contained in:
parent
c88155de85
commit
39b0efbd6a
@ -309,8 +309,6 @@ public class RelationManager {
|
||||
return;
|
||||
}
|
||||
|
||||
String currentDsKey = DataSourceKey.get();
|
||||
try {
|
||||
relations.forEach(relation -> {
|
||||
|
||||
//ignore
|
||||
@ -327,16 +325,12 @@ public class RelationManager {
|
||||
}
|
||||
|
||||
//注解配置的数据源
|
||||
String configDsKey = relation.getDataSource();
|
||||
if (StringUtil.noText(configDsKey) && currentDsKey != null) {
|
||||
configDsKey = currentDsKey;
|
||||
String relationDsKey = relation.getDataSource();
|
||||
if (StringUtil.hasText(relationDsKey)) {
|
||||
DataSourceKey.use(relationDsKey);
|
||||
}
|
||||
|
||||
try {
|
||||
if (StringUtil.hasText(configDsKey)) {
|
||||
DataSourceKey.use(configDsKey);
|
||||
}
|
||||
|
||||
Set<Object> targetValues;
|
||||
List<Row> mappingRows = null;
|
||||
|
||||
@ -391,16 +385,11 @@ public class RelationManager {
|
||||
relation.join(entities, targetObjectList, mappingRows);
|
||||
}
|
||||
} finally {
|
||||
if (StringUtil.hasText(configDsKey)) {
|
||||
if (StringUtil.hasText(relationDsKey)) {
|
||||
DataSourceKey.clear();
|
||||
}
|
||||
}
|
||||
});
|
||||
} finally {
|
||||
if (currentDsKey != null) {
|
||||
DataSourceKey.use(currentDsKey);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user