This is an automated email from the ASF dual-hosted git repository.
jianglongtao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 851c1668fab Add single rule configuration to jdbc example to fix e2e
(#37844)
851c1668fab is described below
commit 851c1668fab799a1934b6af0b09bcb8bb108476b
Author: Raigor <[email protected]>
AuthorDate: Mon Jan 26 11:09:22 2026 +0800
Add single rule configuration to jdbc example to fix e2e (#37844)
* Add single rule configuration to jdbc example to fix e2e
* Add single rule configuration to jdbc example to fix e2e
---
.../src/main/resources/template/java/config/Configuration.ftl | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git
a/examples/shardingsphere-jdbc-example-generator/src/main/resources/template/java/config/Configuration.ftl
b/examples/shardingsphere-jdbc-example-generator/src/main/resources/template/java/config/Configuration.ftl
index 0d92e487507..761a26882c1 100644
---
a/examples/shardingsphere-jdbc-example-generator/src/main/resources/template/java/config/Configuration.ftl
+++
b/examples/shardingsphere-jdbc-example-generator/src/main/resources/template/java/config/Configuration.ftl
@@ -23,6 +23,7 @@ import
org.apache.shardingsphere.driver.api.ShardingSphereDataSourceFactory;
import org.apache.shardingsphere.infra.config.props.ConfigurationPropertyKey;
import org.apache.shardingsphere.infra.config.rule.RuleConfiguration;
import org.apache.shardingsphere.infra.config.mode.ModeConfiguration;
+import org.apache.shardingsphere.single.config.SingleRuleConfiguration;
<#if mode=="standalone">
import
org.apache.shardingsphere.mode.repository.standalone.StandalonePersistRepositoryConfiguration;
<#else>
@@ -127,6 +128,7 @@ public final class Configuration {
private Collection<RuleConfiguration> createRuleConfiguration() {
Collection<RuleConfiguration> result = new LinkedList<>();
+ result.add(createSingleRuleConfiguration());
<#if transaction!="local">
result.add(createTransactionRuleConfiguration());
</#if>
@@ -147,7 +149,7 @@ public final class Configuration {
<#if feature?contains("mask")>
result.add(createMaskRuleConfiguration());
</#if>
- return result;
+ return result;
}
<#list feature?split(",") as item>
<#include "${item}.ftl">
@@ -164,7 +166,11 @@ public final class Configuration {
</#if>
}
</#if>
-
+
+ private SingleRuleConfiguration createSingleRuleConfiguration() {
+ return new SingleRuleConfiguration(Collections.singletonList("*.*"),
null);
+ }
+
private Properties createProperties() {
Properties result = new Properties();
result.setProperty(ConfigurationPropertyKey.SQL_SHOW.getKey(), "true");