use of io.shardingjdbc.core.api.config.strategy.StandardShardingStrategyConfiguration in project sharding-jdbc by shardingjdbc.
the class ShardingRuleTest method createTableRuleConfigWithAllStrategies.
private TableRuleConfiguration createTableRuleConfigWithAllStrategies() {
TableRuleConfiguration result = new TableRuleConfiguration();
result.setLogicTable("LOGIC_TABLE");
result.setActualDataNodes("ds${0..1}.table_${0..2}");
result.setDatabaseShardingStrategyConfig(new StandardShardingStrategyConfiguration("column", new TestPreciseShardingAlgorithm()));
result.setTableShardingStrategyConfig(new NoneShardingStrategyConfiguration());
return result;
}
use of io.shardingjdbc.core.api.config.strategy.StandardShardingStrategyConfiguration in project sharding-jdbc by shardingjdbc.
the class ShardingNamespaceTest method assertRangeStandardStrategy.
@Test
public void assertRangeStandardStrategy() {
StandardShardingStrategyConfiguration rangeStandardStrategy = this.applicationContext.getBean("rangeStandardStrategy", StandardShardingStrategyConfiguration.class);
assertThat(rangeStandardStrategy.getShardingColumn(), is("order_id"));
assertThat(rangeStandardStrategy.getPreciseShardingAlgorithm(), instanceOf(PreciseModuloTableShardingAlgorithm.class));
assertThat(rangeStandardStrategy.getRangeShardingAlgorithm(), instanceOf(RangeModuloTableShardingAlgorithm.class));
}
Aggregations