You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/04/13 15:56:23 UTC
[GitHub] [incubator-shardingsphere] kimmking commented on issue #5168:
[DISCUSS] Simplify the configuration API of ShardingKeyGenerator on spring
namespace
kimmking commented on issue #5168: [DISCUSS] Simplify the configuration API of ShardingKeyGenerator on spring namespace
URL: https://github.com/apache/incubator-shardingsphere/issues/5168#issuecomment-612960330
IMO, if we need share a singleton bean, the first config style is simple enough:
```
<bean id="incrementAlgorithm" class="org.apache.shardingsphere.shardingjdbc.spring.namespace.factorybean.KeyGenerateAlgorithmFactoryBean">
<property name="type" value="INCREMENT" />
</bean>
<sharding:key-generator id="orderKeyGenerator" column="order_id" algorithm-ref="incrementAlgorithm" />
```
And if no need to share it, the simplest config style is:
```
<sharding:key-generator id="orderKeyGenerator" column="order_id" type="INCREMENT" />
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services