use of io.shardingjdbc.core.yaml.sharding.strategy.YamlInlineShardingStrategyConfiguration in project sharding-jdbc by shardingjdbc.
the class YamlShardingStrategyConfigurationTest method assertBuildWithMultipleSHardingStrategies.
@Test(expected = IllegalArgumentException.class)
public void assertBuildWithMultipleSHardingStrategies() {
YamlShardingStrategyConfiguration actual = new YamlShardingStrategyConfiguration();
YamlInlineShardingStrategyConfiguration inlineShardingStrategyConfig = new YamlInlineShardingStrategyConfiguration();
inlineShardingStrategyConfig.setShardingColumn("order_id");
inlineShardingStrategyConfig.setAlgorithmExpression("t_order_${order_id % 2}");
actual.setInline(inlineShardingStrategyConfig);
actual.setNone(new YamlNoneShardingStrategyConfiguration());
actual.build();
}
use of io.shardingjdbc.core.yaml.sharding.strategy.YamlInlineShardingStrategyConfiguration in project sharding-jdbc by shardingjdbc.
the class YamlShardingStrategyConfigurationTest method createInlineShardingStrategyConfig.
private YamlShardingStrategyConfiguration createInlineShardingStrategyConfig() {
YamlInlineShardingStrategyConfiguration inlineShardingStrategyConfig = new YamlInlineShardingStrategyConfiguration();
inlineShardingStrategyConfig.setShardingColumn("order_id");
inlineShardingStrategyConfig.setAlgorithmExpression("t_order_${order_id % 2}");
YamlShardingStrategyConfiguration result = new YamlShardingStrategyConfiguration();
result.setInline(inlineShardingStrategyConfig);
return result;
}
Aggregations