Skip to content

Commit

Permalink
Refactor SQLTokenGeneratorBuilder (#33774)
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu authored Nov 24, 2024
1 parent 533d3c3 commit c606e25
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
@RequiredArgsConstructor
public final class EncryptTokenGenerateBuilder implements SQLTokenGeneratorBuilder {

private final EncryptRule encryptRule;
private final EncryptRule rule;

private final SQLStatementContext sqlStatementContext;

Expand All @@ -64,23 +64,23 @@ public final class EncryptTokenGenerateBuilder implements SQLTokenGeneratorBuild
@Override
public Collection<SQLTokenGenerator> getSQLTokenGenerators() {
Collection<SQLTokenGenerator> result = new LinkedList<>();
addSQLTokenGenerator(result, new EncryptSelectProjectionTokenGenerator(encryptRule));
addSQLTokenGenerator(result, new EncryptInsertSelectProjectionTokenGenerator(encryptRule));
addSQLTokenGenerator(result, new EncryptInsertAssignmentTokenGenerator(encryptRule));
addSQLTokenGenerator(result, new EncryptUpdateAssignmentTokenGenerator(encryptRule));
addSQLTokenGenerator(result, new EncryptPredicateColumnTokenGenerator(encryptRule));
addSQLTokenGenerator(result, new EncryptInsertPredicateColumnTokenGenerator(encryptRule));
addSQLTokenGenerator(result, new EncryptPredicateRightValueTokenGenerator(encryptRule));
addSQLTokenGenerator(result, new EncryptInsertPredicateRightValueTokenGenerator(encryptRule));
addSQLTokenGenerator(result, new EncryptInsertValuesTokenGenerator(encryptRule));
addSQLTokenGenerator(result, new EncryptInsertDefaultColumnsTokenGenerator(encryptRule));
addSQLTokenGenerator(result, new EncryptInsertCipherNameTokenGenerator(encryptRule));
addSQLTokenGenerator(result, new EncryptInsertDerivedColumnsTokenGenerator(encryptRule));
addSQLTokenGenerator(result, new EncryptInsertOnUpdateTokenGenerator(encryptRule));
addSQLTokenGenerator(result, new EncryptGroupByItemTokenGenerator(encryptRule));
addSQLTokenGenerator(result, new EncryptIndexColumnTokenGenerator(encryptRule));
addSQLTokenGenerator(result, new EncryptCreateTableTokenGenerator(encryptRule));
addSQLTokenGenerator(result, new EncryptAlterTableTokenGenerator(encryptRule));
addSQLTokenGenerator(result, new EncryptSelectProjectionTokenGenerator(rule));
addSQLTokenGenerator(result, new EncryptInsertSelectProjectionTokenGenerator(rule));
addSQLTokenGenerator(result, new EncryptInsertAssignmentTokenGenerator(rule));
addSQLTokenGenerator(result, new EncryptUpdateAssignmentTokenGenerator(rule));
addSQLTokenGenerator(result, new EncryptPredicateColumnTokenGenerator(rule));
addSQLTokenGenerator(result, new EncryptInsertPredicateColumnTokenGenerator(rule));
addSQLTokenGenerator(result, new EncryptPredicateRightValueTokenGenerator(rule));
addSQLTokenGenerator(result, new EncryptInsertPredicateRightValueTokenGenerator(rule));
addSQLTokenGenerator(result, new EncryptInsertValuesTokenGenerator(rule));
addSQLTokenGenerator(result, new EncryptInsertDefaultColumnsTokenGenerator(rule));
addSQLTokenGenerator(result, new EncryptInsertCipherNameTokenGenerator(rule));
addSQLTokenGenerator(result, new EncryptInsertDerivedColumnsTokenGenerator(rule));
addSQLTokenGenerator(result, new EncryptInsertOnUpdateTokenGenerator(rule));
addSQLTokenGenerator(result, new EncryptGroupByItemTokenGenerator(rule));
addSQLTokenGenerator(result, new EncryptIndexColumnTokenGenerator(rule));
addSQLTokenGenerator(result, new EncryptCreateTableTokenGenerator(rule));
addSQLTokenGenerator(result, new EncryptAlterTableTokenGenerator(rule));
return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
@RequiredArgsConstructor
public final class ShardingTokenGenerateBuilder implements SQLTokenGeneratorBuilder {

private final ShardingRule shardingRule;
private final ShardingRule rule;

private final RouteContext routeContext;

Expand All @@ -61,13 +61,13 @@ public final class ShardingTokenGenerateBuilder implements SQLTokenGeneratorBuil
@Override
public Collection<SQLTokenGenerator> getSQLTokenGenerators() {
Collection<SQLTokenGenerator> result = new LinkedList<>();
addSQLTokenGenerator(result, new ShardingTableTokenGenerator(shardingRule));
addSQLTokenGenerator(result, new ShardingTableTokenGenerator(rule));
addSQLTokenGenerator(result, new ShardingDistinctProjectionPrefixTokenGenerator());
addSQLTokenGenerator(result, new ShardingProjectionsTokenGenerator());
addSQLTokenGenerator(result, new ShardingOrderByTokenGenerator());
addSQLTokenGenerator(result, new ShardingAggregationDistinctTokenGenerator());
addSQLTokenGenerator(result, new ShardingIndexTokenGenerator(shardingRule));
addSQLTokenGenerator(result, new ShardingConstraintTokenGenerator(shardingRule));
addSQLTokenGenerator(result, new ShardingIndexTokenGenerator(rule));
addSQLTokenGenerator(result, new ShardingConstraintTokenGenerator(rule));
addSQLTokenGenerator(result, new ShardingOffsetTokenGenerator());
addSQLTokenGenerator(result, new ShardingRowCountTokenGenerator());
addSQLTokenGenerator(result, new GeneratedKeyInsertColumnTokenGenerator());
Expand All @@ -76,7 +76,7 @@ public Collection<SQLTokenGenerator> getSQLTokenGenerators() {
addSQLTokenGenerator(result, new ShardingInsertValuesTokenGenerator());
addSQLTokenGenerator(result, new GeneratedKeyInsertValuesTokenGenerator());
addSQLTokenGenerator(result, new ShardingRemoveTokenGenerator());
addSQLTokenGenerator(result, new ShardingCursorTokenGenerator(shardingRule));
addSQLTokenGenerator(result, new ShardingCursorTokenGenerator(rule));
addSQLTokenGenerator(result, new ShardingFetchDirectionTokenGenerator());
return result;
}
Expand Down

0 comments on commit c606e25

Please sign in to comment.