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:
[email protected]


With regards,
Apache Git Services

Reply via email to