kimmking commented on a change in pull request #4945: make key-generator as a 
spring bean on spring namespace.
URL: 
https://github.com/apache/incubator-shardingsphere/pull/4945#discussion_r398257053
 
 

 ##########
 File path: 
sharding-spring/sharding-jdbc-spring/sharding-jdbc-spring-namespace/src/test/resources/META-INF/rdb/withNamespaceGenerateKeyColumns.xml
 ##########
 @@ -31,10 +31,18 @@
     
     <sharding:standard-strategy id="databaseStrategy" 
sharding-column="user_id" 
precise-algorithm-ref="preciseModuloDatabaseShardingAlgorithm" />
     <sharding:standard-strategy id="tableStrategy" sharding-column="order_id" 
precise-algorithm-ref="preciseModuloTableShardingAlgorithm" />
-    
-    <sharding:key-generator id="defaultKeyGenerator" type="INCREMENT" 
column="id" />
-    <sharding:key-generator id="itemKeyGenerator" type="DECREMENT" 
column="order_item_id" />
-    <sharding:key-generator id="orderKeyGenerator" type="INCREMENT" 
column="order_id" />
+
+    <bean id="incrementKeyGenerator" 
class="org.apache.shardingsphere.shardingjdbc.spring.namespace.factorybean.KeyGeneratorFactoryBean">
+        <constructor-arg value="INCREMENT"/>
+    </bean>
+
+    <bean id="decrementKeyGenerator" 
class="org.apache.shardingsphere.shardingjdbc.spring.namespace.factorybean.KeyGeneratorFactoryBean">
+        <constructor-arg value="DECREMENT"/>
+    </bean>
+
+    <sharding:key-generator id="defaultKeyGenerator" column="id" 
generator-ref="incrementKeyGenerator" />
 
 Review comment:
   is there will be puzzle to users:
   a key-generator  and referred a XXKeyGenerator ?

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to