Search in sources :

Example 21 with Column

use of io.shardingjdbc.core.parsing.parser.context.condition.Column in project sharding-jdbc by shardingjdbc.

the class ShardingRuleTest method assertIsShardingColumnForTableShardingStrategy.

@Test
public void assertIsShardingColumnForTableShardingStrategy() {
    ShardingRuleConfiguration shardingRuleConfig = new ShardingRuleConfiguration();
    shardingRuleConfig.getTableRuleConfigs().add(createTableRuleConfigWithTableStrategies());
    assertTrue(new ShardingRule(shardingRuleConfig, createDataSourceNames()).isShardingColumn(new Column("column", "logic_Table")));
}
Also used : ShardingRuleConfiguration(io.shardingjdbc.core.api.config.ShardingRuleConfiguration) Column(io.shardingjdbc.core.parsing.parser.context.condition.Column) Test(org.junit.Test)

Aggregations

Column (io.shardingjdbc.core.parsing.parser.context.condition.Column)21 Condition (io.shardingjdbc.core.parsing.parser.context.condition.Condition)15 ShardingRuleConfiguration (io.shardingjdbc.core.api.config.ShardingRuleConfiguration)5 Test (org.junit.Test)5 Range (com.google.common.collect.Range)4 RangeShardingValue (io.shardingjdbc.core.api.algorithm.sharding.RangeShardingValue)4 SQLExpression (io.shardingjdbc.core.parsing.parser.expression.SQLExpression)4 LinkedList (java.util.LinkedList)4 SQLParsingEngine (io.shardingjdbc.core.parsing.SQLParsingEngine)3 ShardingRule (io.shardingjdbc.core.rule.ShardingRule)3 TestPreciseShardingAlgorithm (io.shardingjdbc.core.api.algorithm.fixture.TestPreciseShardingAlgorithm)2 StandardShardingStrategyConfiguration (io.shardingjdbc.core.api.config.strategy.StandardShardingStrategyConfiguration)2 SQLNumberExpression (io.shardingjdbc.core.parsing.parser.expression.SQLNumberExpression)2 SQLPlaceholderExpression (io.shardingjdbc.core.parsing.parser.expression.SQLPlaceholderExpression)2 DMLStatement (io.shardingjdbc.core.parsing.parser.sql.dml.DMLStatement)2 ExpectedCondition (io.shardingjdbc.core.parsing.integrate.jaxb.condition.ExpectedCondition)1 GeneratedKey (io.shardingjdbc.core.parsing.parser.context.GeneratedKey)1 SQLIgnoreExpression (io.shardingjdbc.core.parsing.parser.expression.SQLIgnoreExpression)1 SQLTextExpression (io.shardingjdbc.core.parsing.parser.expression.SQLTextExpression)1 InsertStatement (io.shardingjdbc.core.parsing.parser.sql.dml.insert.InsertStatement)1