Skip to content

Commit

Permalink
for #2084, OrConditionFiller => ShardingOrConditionFiller
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu committed Apr 25, 2019
1 parent e93506d commit 02e3f6d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
import java.util.Set;

/**
* Encrypt or condition filler.
* Or condition filler for encrypt.
*
* @author duhongjun
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,13 @@
import java.util.Set;

/**
* Or condition filler.
* Or condition filler for sharding.
*
* @author duhongjun
* @author zhangliang
*/
@RequiredArgsConstructor
public final class OrConditionFiller implements SQLSegmentFiller<OrPredicateSegment> {
public final class ShardingOrConditionFiller implements SQLSegmentFiller<OrPredicateSegment> {

private final ShardingRule shardingRule;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public final class ShardingWhereFiller implements SQLSegmentFiller<WhereSegment>

@Override
public void fill(final WhereSegment sqlSegment, final SQLStatement sqlStatement) {
new OrConditionFiller(shardingRule, shardingTableMetaData).fill(sqlSegment.getOrPredicate(), sqlStatement);
new ShardingOrConditionFiller(shardingRule, shardingTableMetaData).fill(sqlSegment.getOrPredicate(), sqlStatement);
sqlStatement.setParametersIndex(sqlSegment.getParameterCount());
if (sqlStatement instanceof DeleteStatement) {
DeleteStatement deleteStatement = (DeleteStatement) sqlStatement;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import org.apache.shardingsphere.core.parse.antlr.filler.api.SQLSegmentFiller;
import org.apache.shardingsphere.core.parse.antlr.filler.api.ShardingRuleAwareFiller;
import org.apache.shardingsphere.core.parse.antlr.filler.api.ShardingTableMetaDataAwareFiller;
import org.apache.shardingsphere.core.parse.antlr.filler.sharding.dml.OrConditionFiller;
import org.apache.shardingsphere.core.parse.antlr.filler.sharding.dml.ShardingOrConditionFiller;
import org.apache.shardingsphere.core.parse.antlr.sql.segment.dml.predicate.OrPredicateSegment;
import org.apache.shardingsphere.core.parse.antlr.sql.segment.dml.predicate.SubqueryPredicateSegment;
import org.apache.shardingsphere.core.parse.antlr.sql.statement.SQLStatement;
Expand All @@ -44,7 +44,7 @@ public final class SubqueryConditionFiller implements SQLSegmentFiller<SubqueryP
@Override
public void fill(final SubqueryPredicateSegment sqlSegment, final SQLStatement sqlStatement) {
SelectStatement selectStatement = (SelectStatement) sqlStatement;
OrConditionFiller orConditionFiller = new OrConditionFiller(shardingRule, shardingTableMetaData);
ShardingOrConditionFiller orConditionFiller = new ShardingOrConditionFiller(shardingRule, shardingTableMetaData);
for (OrPredicateSegment each : sqlSegment.getOrPredicates()) {
selectStatement.getSubqueryConditions().add(orConditionFiller.buildCondition(each, sqlStatement, shardingRule, shardingTableMetaData));
}
Expand Down

0 comments on commit 02e3f6d

Please sign in to comment.