diff --git a/sharding-jdbc-doc/content/post/user_guide.md b/sharding-jdbc-doc/content/post/user_guide.md index 6b769e62c00df..48cff105ebf5c 100644 --- a/sharding-jdbc-doc/content/post/user_guide.md +++ b/sharding-jdbc-doc/content/post/user_guide.md @@ -225,7 +225,7 @@ public Collection doBetweenSharding(final Collection availableTa 下面是一个余2的算法的例子,当分片键的值除以2余数就是实际表的结尾。注意注释中提供了一些算法生成SQL的结果,参数`tableNames`集合中有两个参数`t_order_0`和`t_order_1` ```java - public final class ModuloDatabaseShardingAlgorithm implements SingleKeyDatabaseShardingAlgorithm { + public final class ModuloDatabaseShardingAlgorithm implements SingleKeyTableShardingAlgorithm { /** * select * from t_order from t_order where order_id = 11 @@ -254,9 +254,9 @@ public Collection doBetweenSharding(final Collection availableTa public Collection doInSharding(final Collection tableNames, final ShardingValue shardingValue) { Collection result = new LinkedHashSet<>(tableNames.size()); for (Integer value : shardingValue.getValues()) { - for (String dataSourceName : tableNames) { - if (dataSourceName.endsWith(value % 2 + "")) { - result.add(dataSourceName); + for (String tableName : tableNames) { + if (tableName.endsWith(value % 2 + "")) { + result.add(tableName); } } }