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/12/16 02:36:51 UTC

[GitHub] [shardingsphere] huanghao495430759 commented on issue #8638: Bug for USE JAVA API to to configure two tables

huanghao495430759 commented on issue #8638:
URL: https://github.com/apache/shardingsphere/issues/8638#issuecomment-745725007


   it is your configurations error. 
   
   `Properties tableShardingAlgorithmrProps = new Properties();
       tableShardingAlgorithmrProps.setProperty(
       		"algorithm-expression", "ssuser_${user_id}");
       **shardingRuleConfig.getShardingAlgorithms().put("tableShardingAlgorithm",
       		new ShardingSphereAlgorithmConfiguration("INLINE",
       				tableShardingAlgorithmrProps));**
       
   	
   	Properties tableShardingAlgorithmrProps2 = new Properties();
   	tableShardingAlgorithmrProps2.setProperty(
   			"algorithm-expression", "gateway_${user_id}");
   	
   	**shardingRuleConfig.getShardingAlgorithms().put("tableShardingAlgorithm",
   			new ShardingSphereAlgorithmConfiguration("INLINE", 
   					tableShardingAlgorithmrProps2));`**
   
   when you exetuted shardingRuleConfig.getShardingAlgorithms(), you put the same key 'tableShardingAlgorithm' into map, it was replace of new value  'new ShardingSphereAlgorithmConfiguration("INLINE", tableShardingAlgorithmrProps2)'; 


----------------------------------------------------------------
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