Search in sources :

Example 6 with InlineShardingStrategyConfiguration

use of io.shardingjdbc.core.api.config.strategy.InlineShardingStrategyConfiguration in project sharding-jdbc by shardingjdbc.

the class ShardingNamespaceTest method assertInlineStrategy.

@Test
public void assertInlineStrategy() {
    InlineShardingStrategyConfiguration inlineStrategy = this.applicationContext.getBean("inlineStrategy", InlineShardingStrategyConfiguration.class);
    assertThat(inlineStrategy.getShardingColumn(), is("order_id"));
    assertThat(inlineStrategy.getAlgorithmExpression(), is("t_order_${order_id % 4}"));
}
Also used : InlineShardingStrategyConfiguration(io.shardingjdbc.core.api.config.strategy.InlineShardingStrategyConfiguration) Test(org.junit.Test)

Aggregations

InlineShardingStrategyConfiguration (io.shardingjdbc.core.api.config.strategy.InlineShardingStrategyConfiguration)6 Test (org.junit.Test)4 ComplexShardingStrategyConfiguration (io.shardingjdbc.core.api.config.strategy.ComplexShardingStrategyConfiguration)2 HintShardingStrategyConfiguration (io.shardingjdbc.core.api.config.strategy.HintShardingStrategyConfiguration)2 NoneShardingStrategyConfiguration (io.shardingjdbc.core.api.config.strategy.NoneShardingStrategyConfiguration)2 StandardShardingStrategyConfiguration (io.shardingjdbc.core.api.config.strategy.StandardShardingStrategyConfiguration)2 ShardingRuleConfiguration (io.shardingjdbc.core.api.config.ShardingRuleConfiguration)1 ShardingStrategyConfiguration (io.shardingjdbc.core.api.config.strategy.ShardingStrategyConfiguration)1 YamlComplexShardingStrategyConfiguration (io.shardingjdbc.core.yaml.sharding.strategy.YamlComplexShardingStrategyConfiguration)1 YamlHintShardingStrategyConfiguration (io.shardingjdbc.core.yaml.sharding.strategy.YamlHintShardingStrategyConfiguration)1 YamlInlineShardingStrategyConfiguration (io.shardingjdbc.core.yaml.sharding.strategy.YamlInlineShardingStrategyConfiguration)1 YamlNoneShardingStrategyConfiguration (io.shardingjdbc.core.yaml.sharding.strategy.YamlNoneShardingStrategyConfiguration)1 YamlStandardShardingStrategyConfiguration (io.shardingjdbc.core.yaml.sharding.strategy.YamlStandardShardingStrategyConfiguration)1