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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
String currentDsKey = DataSourceKey.get();
|
|
||||||
try {
|
|
||||||
relations.forEach(relation -> {
|
relations.forEach(relation -> {
|
||||||
|
|
||||||
//ignore
|
//ignore
|
||||||
@ -327,16 +325,12 @@ public class RelationManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//注解配置的数据源
|
//注解配置的数据源
|
||||||
String configDsKey = relation.getDataSource();
|
String relationDsKey = relation.getDataSource();
|
||||||
if (StringUtil.noText(configDsKey) && currentDsKey != null) {
|
if (StringUtil.hasText(relationDsKey)) {
|
||||||
configDsKey = currentDsKey;
|
DataSourceKey.use(relationDsKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (StringUtil.hasText(configDsKey)) {
|
|
||||||
DataSourceKey.use(configDsKey);
|
|
||||||
}
|
|
||||||
|
|
||||||
Set<Object> targetValues;
|
Set<Object> targetValues;
|
||||||
List<Row> mappingRows = null;
|
List<Row> mappingRows = null;
|
||||||
|
|
||||||
@ -391,16 +385,11 @@ public class RelationManager {
|
|||||||
relation.join(entities, targetObjectList, mappingRows);
|
relation.join(entities, targetObjectList, mappingRows);
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
if (StringUtil.hasText(configDsKey)) {
|
if (StringUtil.hasText(relationDsKey)) {
|
||||||
DataSourceKey.clear();
|
DataSourceKey.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} finally {
|
|
||||||
if (currentDsKey != null) {
|
|
||||||
DataSourceKey.use(currentDsKey);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user