Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor SQLTokenGeneratorBuilder #33774

Merged
merged 1 commit into from
Nov 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading