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 5e8e4fa  [Examples] Split hint-example into different modules.  
(#13088)
5e8e4fa is described below

commit 5e8e4facb3909eca1d5eb54ca312043a13d3504c
Author: liguoping <[email protected]>
AuthorDate: Mon Oct 18 15:58:44 2021 +0800

    [Examples] Split hint-example into different modules.  (#13088)
    
    * HINT_TEST spi
    
    * ShardingHintRawExample
    
    * Migrate the hint-write-only example from hint-example to 
readwrite-splitting-example
    
    * delete module hint example
    
    * use ShardingType
    
    * delete HintType
    
    * delete module other-feature-example
---
 .../shardingsphere/example/type/ShardingType.java  |  8 +++-
 .../hint-example/hint-raw-jdbc-example/pom.xml     | 43 ----------------------
 .../example/hint/raw/jdbc/HintType.java            | 23 ------------
 .../src/main/resources/logback.xml                 | 34 -----------------
 .../other-feature-example/hint-example/pom.xml     | 36 ------------------
 .../other-feature-example/pom.xml                  | 35 ------------------
 examples/shardingsphere-jdbc-example/pom.xml       |  1 -
 .../META-INF/readwrite-splitting-hint.yaml}        |  0
 .../jdbc/ReadwriteSplittingHintRawExample.java}    | 34 +++++------------
 .../META-INF/readwrite-splitting-hint.yaml}        |  0
 .../sharding/raw/jdbc/ShardingHintRawExample.java} | 37 ++++++++-----------
 .../jdbc/hint}/ModuloHintShardingAlgorithm.java    |  2 +-
 ...e.shardingsphere.sharding.spi.ShardingAlgorithm |  2 +-
 .../META-INF/sharding-hint-databases-only.yaml}    |  0
 .../META-INF/sharding-hint-databases-tables.yaml}  |  0
 15 files changed, 35 insertions(+), 220 deletions(-)

diff --git 
a/examples/example-core/config-utility/src/main/java/org/apache/shardingsphere/example/type/ShardingType.java
 
b/examples/example-core/config-utility/src/main/java/org/apache/shardingsphere/example/type/ShardingType.java
index 79fdd3e..7a969b1 100644
--- 
a/examples/example-core/config-utility/src/main/java/org/apache/shardingsphere/example/type/ShardingType.java
+++ 
b/examples/example-core/config-utility/src/main/java/org/apache/shardingsphere/example/type/ShardingType.java
@@ -39,5 +39,11 @@ public enum ShardingType {
     
     SHADOW,
     
-    SHARDING_AUTO_TABLES
+    SHARDING_AUTO_TABLES,
+
+    SHARDING_HINT_DATABASES_ONLY,
+
+    SHARDING_HINT_DATABASES_TABLES,
+
+    READWRITE_SPLITTING_HINT
 }
diff --git 
a/examples/shardingsphere-jdbc-example/other-feature-example/hint-example/hint-raw-jdbc-example/pom.xml
 
b/examples/shardingsphere-jdbc-example/other-feature-example/hint-example/hint-raw-jdbc-example/pom.xml
deleted file mode 100644
index 5d2f0b3..0000000
--- 
a/examples/shardingsphere-jdbc-example/other-feature-example/hint-example/hint-raw-jdbc-example/pom.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ Licensed to the Apache Software Foundation (ASF) under one or more
-  ~ contributor license agreements.  See the NOTICE file distributed with
-  ~ this work for additional information regarding copyright ownership.
-  ~ The ASF licenses this file to You under the Apache License, Version 2.0
-  ~ (the "License"); you may not use this file except in compliance with
-  ~ the License.  You may obtain a copy of the License at
-  ~
-  ~     http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~ See the License for the specific language governing permissions and
-  ~ limitations under the License.
-  -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0";
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.apache.shardingsphere.example</groupId>
-        <artifactId>hint-example</artifactId>
-        <version>5.0.0-RC1-SNAPSHOT</version>
-    </parent>
-    <artifactId>hint-raw-jdbc-example</artifactId>
-    <name>${project.artifactId}</name>
-    
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.shardingsphere.example</groupId>
-            <artifactId>example-raw-jdbc</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.shardingsphere</groupId>
-            <artifactId>shardingsphere-jdbc-core</artifactId>
-        </dependency>
-    </dependencies>
-</project>
-
diff --git 
a/examples/shardingsphere-jdbc-example/other-feature-example/hint-example/hint-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/hint/raw/jdbc/HintType.java
 
b/examples/shardingsphere-jdbc-example/other-feature-example/hint-example/hint-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/hint/raw/jdbc/HintType.java
deleted file mode 100644
index 8152bb0..0000000
--- 
a/examples/shardingsphere-jdbc-example/other-feature-example/hint-example/hint-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/hint/raw/jdbc/HintType.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.example.hint.raw.jdbc;
-
-public enum HintType {
-    
-    DATABASE_ONLY, DATABASE_TABLES, WRITE_ONLY
-}
diff --git 
a/examples/shardingsphere-jdbc-example/other-feature-example/hint-example/hint-raw-jdbc-example/src/main/resources/logback.xml
 
b/examples/shardingsphere-jdbc-example/other-feature-example/hint-example/hint-raw-jdbc-example/src/main/resources/logback.xml
deleted file mode 100644
index 965ef5a..0000000
--- 
a/examples/shardingsphere-jdbc-example/other-feature-example/hint-example/hint-raw-jdbc-example/src/main/resources/logback.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ Licensed to the Apache Software Foundation (ASF) under one or more
-  ~ contributor license agreements.  See the NOTICE file distributed with
-  ~ this work for additional information regarding copyright ownership.
-  ~ The ASF licenses this file to You under the Apache License, Version 2.0
-  ~ (the "License"); you may not use this file except in compliance with
-  ~ the License.  You may obtain a copy of the License at
-  ~
-  ~     http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~ See the License for the specific language governing permissions and
-  ~ limitations under the License.
-  -->
-
-<configuration>
-    <property name="log.context.name" value="hint-raw-jdbc-example" />
-    <property name="log.charset" value="UTF-8" />
-    <property name="log.pattern" value="[%-5level] %date --%thread-- [%logger] 
%msg %n" />
-    <contextName>${log.context.name}</contextName>
-    
-    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
-        <encoder charset="${log.charset}">
-            <pattern>${log.pattern}</pattern>
-        </encoder>
-    </appender>
-    <root>
-        <level value="INFO" />
-        <appender-ref ref="STDOUT" />
-    </root>
-</configuration>
diff --git 
a/examples/shardingsphere-jdbc-example/other-feature-example/hint-example/pom.xml
 
b/examples/shardingsphere-jdbc-example/other-feature-example/hint-example/pom.xml
deleted file mode 100644
index c006fc5..0000000
--- 
a/examples/shardingsphere-jdbc-example/other-feature-example/hint-example/pom.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ Licensed to the Apache Software Foundation (ASF) under one or more
-  ~ contributor license agreements.  See the NOTICE file distributed with
-  ~ this work for additional information regarding copyright ownership.
-  ~ The ASF licenses this file to You under the Apache License, Version 2.0
-  ~ (the "License"); you may not use this file except in compliance with
-  ~ the License.  You may obtain a copy of the License at
-  ~
-  ~     http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~ See the License for the specific language governing permissions and
-  ~ limitations under the License.
-  -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0";
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.apache.shardingsphere.example</groupId>
-        <artifactId>other-feature-example</artifactId>
-        <version>5.0.0-RC1-SNAPSHOT</version>
-    </parent>
-    <artifactId>hint-example</artifactId>
-    <name>${project.artifactId}</name>
-    
-    <packaging>pom</packaging>
-    
-    <modules>
-        <module>hint-raw-jdbc-example</module>
-    </modules>
-</project>
diff --git a/examples/shardingsphere-jdbc-example/other-feature-example/pom.xml 
b/examples/shardingsphere-jdbc-example/other-feature-example/pom.xml
deleted file mode 100644
index 5adacf9..0000000
--- a/examples/shardingsphere-jdbc-example/other-feature-example/pom.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ Licensed to the Apache Software Foundation (ASF) under one or more
-  ~ contributor license agreements.  See the NOTICE file distributed with
-  ~ this work for additional information regarding copyright ownership.
-  ~ The ASF licenses this file to You under the Apache License, Version 2.0
-  ~ (the "License"); you may not use this file except in compliance with
-  ~ the License.  You may obtain a copy of the License at
-  ~
-  ~     http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~ See the License for the specific language governing permissions and
-  ~ limitations under the License.
-  -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0";
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.apache.shardingsphere.example</groupId>
-        <artifactId>shardingsphere-jdbc-example</artifactId>
-        <version>5.0.0-RC1-SNAPSHOT</version>
-    </parent>
-    <artifactId>other-feature-example</artifactId>
-    <packaging>pom</packaging>
-    <name>${project.artifactId}</name>
-    
-    <modules>
-        <module>hint-example</module>
-    </modules>
-</project>
diff --git a/examples/shardingsphere-jdbc-example/pom.xml 
b/examples/shardingsphere-jdbc-example/pom.xml
index a66209e..580416a 100644
--- a/examples/shardingsphere-jdbc-example/pom.xml
+++ b/examples/shardingsphere-jdbc-example/pom.xml
@@ -31,7 +31,6 @@
     
     <modules>
         <module>mixed-feature-example</module>
-        <module>other-feature-example</module>
         <module>single-feature-example</module>
     </modules>
 </project>
diff --git 
a/examples/shardingsphere-jdbc-example/other-feature-example/hint-example/hint-raw-jdbc-example/src/main/resources/META-INF/hint-write-only.yaml
 
b/examples/shardingsphere-jdbc-example/single-feature-example/readwrite-splitting-example/readwrite-splitting-raw-jdbc-example/META-INF/readwrite-splitting-hint.yaml
similarity index 100%
rename from 
examples/shardingsphere-jdbc-example/other-feature-example/hint-example/hint-raw-jdbc-example/src/main/resources/META-INF/hint-write-only.yaml
rename to 
examples/shardingsphere-jdbc-example/single-feature-example/readwrite-splitting-example/readwrite-splitting-raw-jdbc-example/META-INF/readwrite-splitting-hint.yaml
diff --git 
a/examples/shardingsphere-jdbc-example/other-feature-example/hint-example/hint-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/hint/raw/jdbc/HintRawExample.java
 
b/examples/shardingsphere-jdbc-example/single-feature-example/readwrite-splitting-example/readwrite-splitting-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/hint/raw/jdbc/ReadwriteSplittingHintRawExample.java
similarity index 73%
copy from 
examples/shardingsphere-jdbc-example/other-feature-example/hint-example/hint-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/hint/raw/jdbc/HintRawExample.java
copy to 
examples/shardingsphere-jdbc-example/single-feature-example/readwrite-splitting-example/readwrite-splitting-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/hint/raw/jdbc/ReadwriteSplittingHintRawExample.java
index 7d08a1d..0744272 100644
--- 
a/examples/shardingsphere-jdbc-example/other-feature-example/hint-example/hint-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/hint/raw/jdbc/HintRawExample.java
+++ 
b/examples/shardingsphere-jdbc-example/single-feature-example/readwrite-splitting-example/readwrite-splitting-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/hint/raw/jdbc/ReadwriteSplittingHintRawExample.java
@@ -1,4 +1,4 @@
-/*
+package org.apache.shardingsphere.example.hint.raw.jdbc;/*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -15,12 +15,11 @@
  * limitations under the License.
  */
 
-package org.apache.shardingsphere.example.hint.raw.jdbc;
-
-import org.apache.shardingsphere.infra.hint.HintManager;
+import 
org.apache.shardingsphere.driver.api.yaml.YamlShardingSphereDataSourceFactory;
 import org.apache.shardingsphere.example.core.api.service.ExampleService;
 import org.apache.shardingsphere.example.core.jdbc.service.OrderServiceImpl;
-import 
org.apache.shardingsphere.driver.api.yaml.YamlShardingSphereDataSourceFactory;
+import org.apache.shardingsphere.example.type.ShardingType;
+import org.apache.shardingsphere.infra.hint.HintManager;
 
 import javax.sql.DataSource;
 import java.io.File;
@@ -29,11 +28,9 @@ import java.sql.Connection;
 import java.sql.SQLException;
 import java.sql.Statement;
 
-public final class HintRawExample {
+public final class ReadwriteSplittingHintRawExample {
 
-    private static final HintType TYPE = HintType.DATABASE_TABLES;
-//    private static final HintType TYPE = HintType.DATABASE_ONLY;
-//    private static final HintType TYPE = HintType.WRITE_ONLY;
+    private static final ShardingType TYPE = 
ShardingType.READWRITE_SPLITTING_HINT;
     
     public static void main(final String[] args) throws SQLException, 
IOException {
         DataSource dataSource = getDataSource();
@@ -45,19 +42,15 @@ public final class HintRawExample {
     
     private static DataSource getDataSource() throws IOException, SQLException 
{
         switch (TYPE) {
-            case DATABASE_TABLES:
-                return 
YamlShardingSphereDataSourceFactory.createDataSource(getFile("/META-INF/hint-databases-tables.yaml"));
-            case DATABASE_ONLY:
-                return 
YamlShardingSphereDataSourceFactory.createDataSource(getFile("/META-INF/hint-databases-only.yaml"));
-            case WRITE_ONLY:
-                return 
YamlShardingSphereDataSourceFactory.createDataSource(getFile("/META-INF/hint-write-only.yaml"));
+            case READWRITE_SPLITTING_HINT:
+                return 
YamlShardingSphereDataSourceFactory.createDataSource(getFile("/META-INF/readwrite-splitting-hint.yaml"));
             default:
                 throw new UnsupportedOperationException("unsupported type");
         }
     }
     
     private static File getFile(final String configFile) {
-        return new 
File(HintRawExample.class.getResource(configFile).getFile());
+        return new 
File(ReadwriteSplittingHintRawExample.class.getResource(configFile).getFile());
     }
     
     private static ExampleService getExampleService(final DataSource 
dataSource) {
@@ -78,14 +71,7 @@ public final class HintRawExample {
     
     private static void setHintValue(final HintManager hintManager) {
         switch (TYPE) {
-            case DATABASE_TABLES:
-                hintManager.addDatabaseShardingValue("t_order", 1L);
-                hintManager.addTableShardingValue("t_order", 1L);
-                return;
-            case DATABASE_ONLY:
-                hintManager.setDatabaseShardingValue(1L);
-                return;
-            case WRITE_ONLY:
+            case READWRITE_SPLITTING_HINT:
                 hintManager.setWriteRouteOnly();
                 return;
             default:
diff --git 
a/examples/shardingsphere-jdbc-example/single-feature-example/readwrite-splitting-example/readwrite-splitting-raw-jdbc-example/readwrite-splitting.yaml
 
b/examples/shardingsphere-jdbc-example/single-feature-example/readwrite-splitting-example/readwrite-splitting-raw-jdbc-example/src/main/resources/META-INF/readwrite-splitting-hint.yaml
similarity index 100%
rename from 
examples/shardingsphere-jdbc-example/single-feature-example/readwrite-splitting-example/readwrite-splitting-raw-jdbc-example/readwrite-splitting.yaml
rename to 
examples/shardingsphere-jdbc-example/single-feature-example/readwrite-splitting-example/readwrite-splitting-raw-jdbc-example/src/main/resources/META-INF/readwrite-splitting-hint.yaml
diff --git 
a/examples/shardingsphere-jdbc-example/other-feature-example/hint-example/hint-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/hint/raw/jdbc/HintRawExample.java
 
b/examples/shardingsphere-jdbc-example/single-feature-example/sharding-example/sharding-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/sharding/raw/jdbc/ShardingHintRawExample.java
similarity index 78%
rename from 
examples/shardingsphere-jdbc-example/other-feature-example/hint-example/hint-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/hint/raw/jdbc/HintRawExample.java
rename to 
examples/shardingsphere-jdbc-example/single-feature-example/sharding-example/sharding-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/sharding/raw/jdbc/ShardingHintRawExample.java
index 7d08a1d..a9319c2 100644
--- 
a/examples/shardingsphere-jdbc-example/other-feature-example/hint-example/hint-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/hint/raw/jdbc/HintRawExample.java
+++ 
b/examples/shardingsphere-jdbc-example/single-feature-example/sharding-example/sharding-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/sharding/raw/jdbc/ShardingHintRawExample.java
@@ -15,12 +15,13 @@
  * limitations under the License.
  */
 
-package org.apache.shardingsphere.example.hint.raw.jdbc;
+package org.apache.shardingsphere.example.sharding.raw.jdbc;
 
-import org.apache.shardingsphere.infra.hint.HintManager;
+import 
org.apache.shardingsphere.driver.api.yaml.YamlShardingSphereDataSourceFactory;
 import org.apache.shardingsphere.example.core.api.service.ExampleService;
 import org.apache.shardingsphere.example.core.jdbc.service.OrderServiceImpl;
-import 
org.apache.shardingsphere.driver.api.yaml.YamlShardingSphereDataSourceFactory;
+import org.apache.shardingsphere.example.type.ShardingType;
+import org.apache.shardingsphere.infra.hint.HintManager;
 
 import javax.sql.DataSource;
 import java.io.File;
@@ -29,12 +30,11 @@ import java.sql.Connection;
 import java.sql.SQLException;
 import java.sql.Statement;
 
-public final class HintRawExample {
+public final class ShardingHintRawExample {
+
+    private static final ShardingType TYPE = 
ShardingType.SHARDING_HINT_DATABASES_ONLY;
+//    private static final ShardingType TYPE = 
ShardingType.SHARDING_HINT_DATABASES_TABLES;
 
-    private static final HintType TYPE = HintType.DATABASE_TABLES;
-//    private static final HintType TYPE = HintType.DATABASE_ONLY;
-//    private static final HintType TYPE = HintType.WRITE_ONLY;
-    
     public static void main(final String[] args) throws SQLException, 
IOException {
         DataSource dataSource = getDataSource();
         ExampleService exampleService = getExampleService(dataSource);
@@ -45,19 +45,17 @@ public final class HintRawExample {
     
     private static DataSource getDataSource() throws IOException, SQLException 
{
         switch (TYPE) {
-            case DATABASE_TABLES:
-                return 
YamlShardingSphereDataSourceFactory.createDataSource(getFile("/META-INF/hint-databases-tables.yaml"));
-            case DATABASE_ONLY:
-                return 
YamlShardingSphereDataSourceFactory.createDataSource(getFile("/META-INF/hint-databases-only.yaml"));
-            case WRITE_ONLY:
-                return 
YamlShardingSphereDataSourceFactory.createDataSource(getFile("/META-INF/hint-write-only.yaml"));
+            case SHARDING_HINT_DATABASES_ONLY:
+                return 
YamlShardingSphereDataSourceFactory.createDataSource(getFile("/META-INF/sharding-hint-databases-only.yaml"));
+            case SHARDING_HINT_DATABASES_TABLES:
+                return 
YamlShardingSphereDataSourceFactory.createDataSource(getFile("/META-INF/sharding-hint-databases-tables.yaml"));
             default:
                 throw new UnsupportedOperationException("unsupported type");
         }
     }
     
     private static File getFile(final String configFile) {
-        return new 
File(HintRawExample.class.getResource(configFile).getFile());
+        return new 
File(ShardingHintRawExample.class.getResource(configFile).getFile());
     }
     
     private static ExampleService getExampleService(final DataSource 
dataSource) {
@@ -78,16 +76,13 @@ public final class HintRawExample {
     
     private static void setHintValue(final HintManager hintManager) {
         switch (TYPE) {
-            case DATABASE_TABLES:
-                hintManager.addDatabaseShardingValue("t_order", 1L);
+            case SHARDING_HINT_DATABASES_ONLY:
+                hintManager.addDatabaseShardingValue("t_order", 2L);
                 hintManager.addTableShardingValue("t_order", 1L);
                 return;
-            case DATABASE_ONLY:
+            case SHARDING_HINT_DATABASES_TABLES:
                 hintManager.setDatabaseShardingValue(1L);
                 return;
-            case WRITE_ONLY:
-                hintManager.setWriteRouteOnly();
-                return;
             default:
                 throw new UnsupportedOperationException("unsupported type");
         }
diff --git 
a/examples/shardingsphere-jdbc-example/other-feature-example/hint-example/hint-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/hint/raw/jdbc/ModuloHintShardingAlgorithm.java
 
b/examples/shardingsphere-jdbc-example/single-feature-example/sharding-example/sharding-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/sharding/raw/jdbc/hint/ModuloHintShardingAlgorithm.java
similarity index 96%
rename from 
examples/shardingsphere-jdbc-example/other-feature-example/hint-example/hint-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/hint/raw/jdbc/ModuloHintShardingAlgorithm.java
rename to 
examples/shardingsphere-jdbc-example/single-feature-example/sharding-example/sharding-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/sharding/raw/jdbc/hint/ModuloHintShardingAlgorithm.java
index 92beac5..5b18131 100644
--- 
a/examples/shardingsphere-jdbc-example/other-feature-example/hint-example/hint-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/hint/raw/jdbc/ModuloHintShardingAlgorithm.java
+++ 
b/examples/shardingsphere-jdbc-example/single-feature-example/sharding-example/sharding-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/sharding/raw/jdbc/hint/ModuloHintShardingAlgorithm.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.shardingsphere.example.hint.raw.jdbc;
+package org.apache.shardingsphere.example.sharding.raw.jdbc.hint;
 
 import 
org.apache.shardingsphere.sharding.api.sharding.hint.HintShardingAlgorithm;
 import org.apache.shardingsphere.sharding.api.sharding.hint.HintShardingValue;
diff --git 
a/examples/shardingsphere-jdbc-example/other-feature-example/hint-example/hint-raw-jdbc-example/src/main/resources/META-INF/services/org.apache.shardingsphere.sharding.spi.ShardingAlgorithm
 
b/examples/shardingsphere-jdbc-example/single-feature-example/sharding-example/sharding-raw-jdbc-example/src/main/resources/META-INF/services/org.apache.shardingsphere.sharding.spi.ShardingAlgorithm
similarity index 90%
rename from 
examples/shardingsphere-jdbc-example/other-feature-example/hint-example/hint-raw-jdbc-example/src/main/resources/META-INF/services/org.apache.shardingsphere.sharding.spi.ShardingAlgorithm
rename to 
examples/shardingsphere-jdbc-example/single-feature-example/sharding-example/sharding-raw-jdbc-example/src/main/resources/META-INF/services/org.apache.shardingsphere.sharding.spi.ShardingAlgorithm
index 7c7d47d..c739099 100644
--- 
a/examples/shardingsphere-jdbc-example/other-feature-example/hint-example/hint-raw-jdbc-example/src/main/resources/META-INF/services/org.apache.shardingsphere.sharding.spi.ShardingAlgorithm
+++ 
b/examples/shardingsphere-jdbc-example/single-feature-example/sharding-example/sharding-raw-jdbc-example/src/main/resources/META-INF/services/org.apache.shardingsphere.sharding.spi.ShardingAlgorithm
@@ -15,4 +15,4 @@
 # limitations under the License.
 #
  
-org.apache.shardingsphere.example.hint.raw.jdbc.ModuloHintShardingAlgorithm
+org.apache.shardingsphere.example.sharding.raw.jdbc.hint.ModuloHintShardingAlgorithm
diff --git 
a/examples/shardingsphere-jdbc-example/other-feature-example/hint-example/hint-raw-jdbc-example/src/main/resources/META-INF/hint-databases-only.yaml
 
b/examples/shardingsphere-jdbc-example/single-feature-example/sharding-example/sharding-raw-jdbc-example/src/main/resources/META-INF/sharding-hint-databases-only.yaml
similarity index 100%
rename from 
examples/shardingsphere-jdbc-example/other-feature-example/hint-example/hint-raw-jdbc-example/src/main/resources/META-INF/hint-databases-only.yaml
rename to 
examples/shardingsphere-jdbc-example/single-feature-example/sharding-example/sharding-raw-jdbc-example/src/main/resources/META-INF/sharding-hint-databases-only.yaml
diff --git 
a/examples/shardingsphere-jdbc-example/other-feature-example/hint-example/hint-raw-jdbc-example/src/main/resources/META-INF/hint-databases-tables.yaml
 
b/examples/shardingsphere-jdbc-example/single-feature-example/sharding-example/sharding-raw-jdbc-example/src/main/resources/META-INF/sharding-hint-databases-tables.yaml
similarity index 100%
rename from 
examples/shardingsphere-jdbc-example/other-feature-example/hint-example/hint-raw-jdbc-example/src/main/resources/META-INF/hint-databases-tables.yaml
rename to 
examples/shardingsphere-jdbc-example/single-feature-example/sharding-example/sharding-raw-jdbc-example/src/main/resources/META-INF/sharding-hint-databases-tables.yaml

Reply via email to