Search in sources :

Example 1 with YamlComplexShardingStrategyConfiguration

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

the class YamlShardingStrategyConfigurationTest method createComplexShardingStrategyConfig.

private YamlShardingStrategyConfiguration createComplexShardingStrategyConfig() {
    YamlComplexShardingStrategyConfiguration complexShardingStrategyConfig = new YamlComplexShardingStrategyConfiguration();
    complexShardingStrategyConfig.setShardingColumns("user_id, order_id");
    complexShardingStrategyConfig.setAlgorithmClassName(ComplexOrderShardingAlgorithm.class.getName());
    YamlShardingStrategyConfiguration result = new YamlShardingStrategyConfiguration();
    result.setComplex(complexShardingStrategyConfig);
    return result;
}
Also used : ComplexOrderShardingAlgorithm(io.shardingjdbc.core.fixture.ComplexOrderShardingAlgorithm) YamlComplexShardingStrategyConfiguration(io.shardingjdbc.core.yaml.sharding.strategy.YamlComplexShardingStrategyConfiguration)

Aggregations

ComplexOrderShardingAlgorithm (io.shardingjdbc.core.fixture.ComplexOrderShardingAlgorithm)1 YamlComplexShardingStrategyConfiguration (io.shardingjdbc.core.yaml.sharding.strategy.YamlComplexShardingStrategyConfiguration)1