Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangOranges committed Nov 13, 2023
1 parent e70c639 commit fcc1cf9
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,14 @@ public RouteContext route(final ShardingRule shardingRule) {
return result;
}
DataNode dataNode = shardingRule.getDataNode(logicTableName);
//use allDataNode
Collection<DataNode> dataNodes = shardingRule.getAllDataNodes().get(logicTableName);
List<RouteMapper> list = new ArrayList<>();
for (DataNode node : dataNodes) {
list.add(new RouteMapper(logicTableName, node.getTableName()));
}
result.getRouteUnits().add(new RouteUnit(new RouteMapper(dataNode.getDataSourceName(), dataNode.getDataSourceName()),
Collections.singletonList(new RouteMapper(logicTableName, dataNode.getTableName()))));
list));
} else {
routeWithMultipleTables(result, shardingRule);
}
Expand Down

0 comments on commit fcc1cf9

Please sign in to comment.