sunlife95 commented on issue #27494:
URL:
https://github.com/apache/shardingsphere/issues/27494#issuecomment-1664180334
> How to solve it via JAVA API ?
i solved with this code
/**
* 初始化单表规则
*/
private SingleRuleConfiguration getSingleRuleConfiguration() {
List<String> singleTableList = Lists.newArrayList();
singleTableList.add("*.*");
return new SingleRuleConfiguration(singleTableList, "ds_0");
}
when i init datasource
// 单表配置
SingleRuleConfiguration singleRuleConfiguration =
getSingleRuleConfiguration();
ShardingSphereDataSourceFactory.createDataSource("ds_0", new
ModeConfiguration("Standalone", null), createDataSourceMap(),
Lists.newArrayList(shardingRuleConfiguration,
readwriteSplittingRuleConfiguration), props);
it's not standard code ~ but it worked in my project
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]