use of io.shardingjdbc.core.yaml.sharding.strategy.YamlNoneShardingStrategyConfiguration in project sharding-jdbc by shardingjdbc.
the class YamlShardingRuleConfigurationTest method createYamlShardingRuleConfigWithDefaultStrategy.
private YamlShardingRuleConfiguration createYamlShardingRuleConfigWithDefaultStrategy() {
YamlShardingRuleConfiguration result = createYamlShardingRuleConfigWithoutDefaultStrategy();
YamlShardingStrategyConfiguration yamlShardingStrategyConfig = new YamlShardingStrategyConfiguration();
yamlShardingStrategyConfig.setNone(new YamlNoneShardingStrategyConfiguration());
result.setDefaultDatabaseStrategy(yamlShardingStrategyConfig);
result.setDefaultTableStrategy(yamlShardingStrategyConfig);
return result;
}
use of io.shardingjdbc.core.yaml.sharding.strategy.YamlNoneShardingStrategyConfiguration in project sharding-jdbc by shardingjdbc.
the class YamlShardingStrategyConfigurationTest method createNoneShardingStrategyConfig.
private YamlShardingStrategyConfiguration createNoneShardingStrategyConfig() {
YamlNoneShardingStrategyConfiguration noneShardingStrategyConfig = new YamlNoneShardingStrategyConfiguration();
YamlShardingStrategyConfiguration result = new YamlShardingStrategyConfiguration();
result.setNone(noneShardingStrategyConfig);
return result;
}
use of io.shardingjdbc.core.yaml.sharding.strategy.YamlNoneShardingStrategyConfiguration 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.YamlNoneShardingStrategyConfiguration in project sharding-jdbc by shardingjdbc.
the class YamlTableRuleConfigurationTest method createYamlTableRuleConfigWithShardingStrategy.
private YamlTableRuleConfiguration createYamlTableRuleConfigWithShardingStrategy() {
YamlTableRuleConfiguration result = createYamlTableRuleConfig();
YamlShardingStrategyConfiguration yamlShardingStrategyConfig = new YamlShardingStrategyConfiguration();
yamlShardingStrategyConfig.setNone(new YamlNoneShardingStrategyConfiguration());
result.setDatabaseStrategy(yamlShardingStrategyConfig);
result.setTableStrategy(yamlShardingStrategyConfig);
return result;
}
Aggregations