Search in sources :

Example 1 with YamlStandardShardingStrategyConfiguration

use of io.shardingjdbc.core.yaml.sharding.strategy.YamlStandardShardingStrategyConfiguration in project sharding-jdbc by shardingjdbc.

the class YamlShardingStrategyConfigurationTest method createStandardShardingStrategyConfig.

private YamlShardingStrategyConfiguration createStandardShardingStrategyConfig() {
    YamlStandardShardingStrategyConfiguration standardShardingStrategyConfig = new YamlStandardShardingStrategyConfiguration();
    standardShardingStrategyConfig.setShardingColumn("order_id");
    standardShardingStrategyConfig.setPreciseAlgorithmClassName(PreciseOrderShardingAlgorithm.class.getName());
    standardShardingStrategyConfig.setRangeAlgorithmClassName(RangeOrderShardingAlgorithm.class.getName());
    YamlShardingStrategyConfiguration result = new YamlShardingStrategyConfiguration();
    result.setStandard(standardShardingStrategyConfig);
    return result;
}
Also used : PreciseOrderShardingAlgorithm(io.shardingjdbc.core.fixture.PreciseOrderShardingAlgorithm) YamlStandardShardingStrategyConfiguration(io.shardingjdbc.core.yaml.sharding.strategy.YamlStandardShardingStrategyConfiguration) RangeOrderShardingAlgorithm(io.shardingjdbc.core.fixture.RangeOrderShardingAlgorithm)

Aggregations

PreciseOrderShardingAlgorithm (io.shardingjdbc.core.fixture.PreciseOrderShardingAlgorithm)1 RangeOrderShardingAlgorithm (io.shardingjdbc.core.fixture.RangeOrderShardingAlgorithm)1 YamlStandardShardingStrategyConfiguration (io.shardingjdbc.core.yaml.sharding.strategy.YamlStandardShardingStrategyConfiguration)1