You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by me...@apache.org on 2021/09/07 13:21:09 UTC
[shardingsphere] branch caict_scan updated: Remove : remove example
for CAICT scanner (#12275)
This is an automated email from the ASF dual-hosted git repository.
menghaoran pushed a commit to branch caict_scan
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/caict_scan by this push:
new 2a9488e Remove : remove example for CAICT scanner (#12275)
2a9488e is described below
commit 2a9488e2357179d23d622eed1be370005772a4aa
Author: 孙念君 Sun Nianjun <su...@sphere-ex.com>
AuthorDate: Tue Sep 7 21:20:26 2021 +0800
Remove : remove example for CAICT scanner (#12275)
---
examples/README.md | 96 -----
examples/README_ZH.md | 96 -----
examples/docker/docker-compose-zh.md | 21 -
examples/docker/docker-compose.md | 21 -
.../sharding/docker-compose.yml | 60 ---
.../governance/docker-compose.yml | 42 --
.../docker/shardingsphere-proxy/governance/run.sh | 19 -
.../docker/shardingsphere-proxy/governance/stop.sh | 19 -
.../sharding/conf/config-sharding.yaml | 83 ----
.../shardingsphere-proxy/sharding/conf/server.yaml | 45 ---
.../sharding/docker-compose.yml | 58 ---
examples/docker/tools/wait-for-it.sh | 195 ----------
examples/example-core/config-utility/pom.xml | 41 --
.../StandardModuloShardingDatabaseAlgorithm.java | 72 ----
.../StandardModuloShardingTableAlgorithm.java | 64 ---
.../example/config/ExampleConfiguration.java | 26 --
.../TestQueryAssistedShardingEncryptAlgorithm.java | 54 ---
.../example/type/RegistryCenterType.java | 23 --
.../shardingsphere/example/type/ShardingType.java | 41 --
...che.shardingsphere.encrypt.spi.EncryptAlgorithm | 18 -
...e.shardingsphere.sharding.spi.ShardingAlgorithm | 19 -
examples/example-core/example-api/pom.xml | 30 --
.../example/core/api/DataSourceUtil.java | 42 --
.../example/core/api/ExampleExecuteTemplate.java | 43 ---
.../example/core/api/entity/Address.java | 45 ---
.../example/core/api/entity/Order.java | 70 ----
.../example/core/api/entity/OrderItem.java | 70 ----
.../example/core/api/entity/ShadowUser.java | 90 -----
.../example/core/api/entity/User.java | 60 ---
.../core/api/repository/AddressRepository.java | 23 --
.../core/api/repository/CommonRepository.java | 70 ----
.../core/api/repository/OrderItemRepository.java | 23 --
.../core/api/repository/OrderRepository.java | 23 --
.../core/api/repository/ShadowUserRepository.java | 23 --
.../core/api/repository/UserRepository.java | 23 --
.../example/core/api/service/ExampleService.java | 58 ---
examples/example-core/example-raw-jdbc/pom.xml | 43 ---
.../jdbc/repository/AddressRepositoryImpl.java | 110 ------
.../jdbc/repository/OrderItemRepositoryImpl.java | 120 ------
.../core/jdbc/repository/OrderRepositoryImpl.java | 117 ------
.../repository/RangeOrderItemRepositoryImpl.java | 37 --
.../jdbc/repository/RangeOrderRepositoryImpl.java | 37 --
.../jdbc/repository/ShadowUserRepositoryImpl.java | 123 ------
.../core/jdbc/repository/UserRepositoryImpl.java | 112 ------
.../core/jdbc/service/OrderServiceImpl.java | 156 --------
.../core/jdbc/service/ShadowUserServiceImpl.java | 94 -----
.../example/core/jdbc/service/UserServiceImpl.java | 93 -----
examples/example-core/example-spring-jpa/pom.xml | 64 ---
.../example/core/jpa/entity/AddressEntity.java | 45 ---
.../example/core/jpa/entity/OrderEntity.java | 60 ---
.../example/core/jpa/entity/OrderItemEntity.java | 60 ---
.../example/core/jpa/entity/ShadowUserEntity.java | 57 ---
.../example/core/jpa/entity/UserEntity.java | 52 ---
.../core/jpa/repository/AddressRepositoryImpl.java | 70 ----
.../jpa/repository/OrderItemRepositoryImpl.java | 70 ----
.../core/jpa/repository/OrderRepositoryImpl.java | 70 ----
.../jpa/repository/ShadowUserRepositoryImpl.java | 78 ----
.../core/jpa/repository/UserRepositoryImpl.java | 70 ----
.../example/core/jpa/service/OrderServiceImpl.java | 121 ------
.../core/jpa/service/ShadowUserServiceImpl.java | 94 -----
.../example/core/jpa/service/UserServiceImpl.java | 93 -----
.../example-core/example-spring-mybatis/pom.xml | 59 ---
.../repository/MybatisAddressRepository.java | 25 --
.../repository/MybatisOrderItemRepository.java | 25 --
.../mybatis/repository/MybatisOrderRepository.java | 25 --
.../repository/MybatisShadowUserRepository.java | 40 --
.../mybatis/repository/MybatisUserRepository.java | 23 --
.../core/mybatis/service/OrderServiceImpl.java | 133 -------
.../mybatis/service/ShadowUserServiceImpl.java | 94 -----
.../core/mybatis/service/UserServiceImpl.java | 93 -----
.../resources/META-INF/mappers/AddressMapper.xml | 50 ---
.../resources/META-INF/mappers/OrderItemMapper.xml | 55 ---
.../resources/META-INF/mappers/OrderMapper.xml | 55 ---
.../META-INF/mappers/ShadowUserMapper.xml | 56 ---
.../main/resources/META-INF/mappers/UserMapper.xml | 51 ---
examples/example-core/pom.xml | 39 --
examples/pom.xml | 428 ---------------------
.../cluster-mode-raw-jdbc-example/pom.xml | 51 ---
.../ClusterModeRawJavaConfigurationExample.java | 99 -----
.../ClusterModeRawYamlConfigurationExample.java | 92 -----
.../jdbc/config/ClusterModeConfigurationUtil.java | 49 ---
.../config/cloud/CloudEncryptConfiguration.java | 39 --
.../CloudReadwriteSplittingConfiguration.java | 39 --
.../config/cloud/CloudShadowConfiguration.java | 39 --
...oudShardingDatabasesAndTablesConfiguration.java | 39 --
.../config/local/LocalEncryptConfiguration.java | 62 ---
.../LocalReadwriteSplittingConfiguration.java | 58 ---
.../config/local/LocalShadowConfiguration.java | 56 ---
...calShardingDatabasesAndTablesConfiguration.java | 92 -----
.../local/LocalShardingDatabasesConfiguration.java | 90 -----
...calShardingReadwriteSplittingConfiguration.java | 111 ------
.../local/LocalShardingTablesConfiguration.java | 87 -----
.../META-INF/zookeeper/cloud/encrypt.yaml | 25 --
.../zookeeper/cloud/readwrite-splitting.yaml | 25 --
.../resources/META-INF/zookeeper/cloud/shadow.yaml | 25 --
.../zookeeper/cloud/sharding-databases-tables.yaml | 27 --
.../META-INF/zookeeper/local/encrypt.yaml | 50 ---
.../zookeeper/local/readwrite-splitting.yaml | 55 ---
.../resources/META-INF/zookeeper/local/shadow.yaml | 50 ---
.../zookeeper/local/sharding-databases-tables.yaml | 94 -----
.../src/main/resources/logback.xml | 34 --
.../pom.xml | 50 ---
.../ClusterModeSpringBootMybatisExample.java | 41 --
.../src/main/resources/META-INF/mybatis-config.xml | 30 --
.../application-cloud-zookeeper-encrypt.properties | 22 --
...-cloud-zookeeper-readwrite-splitting.properties | 22 --
.../application-cloud-zookeeper-shadow.properties | 22 --
...-zookeeper-sharding-databases-tables.properties | 24 --
.../application-local-zookeeper-encrypt.properties | 38 --
...-local-zookeeper-readwrite-splitting.properties | 47 ---
.../application-local-zookeeper-shadow.properties | 42 --
...-zookeeper-sharding-databases-tables.properties | 75 ----
.../src/main/resources/application.properties | 30 --
.../src/main/resources/logback.xml | 34 --
.../pom.xml | 51 ---
.../ClusterModeSpringNamespaceMybatisExample.java | 61 ---
.../zookeeper/cloud/application-encrypt.xml | 52 ---
.../cloud/application-readwrite-splitting.xml | 52 ---
.../zookeeper/cloud/application-shadow.xml | 53 ---
.../application-sharding-databases-tables.xml | 52 ---
.../zookeeper/local/application-encrypt.xml | 79 ----
.../local/application-readwrite-splitting.xml | 85 ----
.../zookeeper/local/application-shadow.xml | 74 ----
.../application-sharding-databases-tables.xml | 117 ------
.../META-INF/zookeeper/registry-center.xml | 31 --
.../src/main/resources/logback.xml | 34 --
.../cluster-mode-example/pom.xml | 37 --
.../class-based-sharding-algorithm-example/pom.xml | 42 --
.../YamlClassBasedShardingAlgorithmExample.java | 42 --
.../classbased/factory/YamlDataSourceFactory.java | 42 --
...ClassBasedStandardShardingAlgorithmFixture.java | 51 ---
.../resources/META-INF/sharding-databases.yaml | 70 ----
.../src/main/resources/logback.xml | 34 --
.../custom-sharding-algortihm-example/pom.xml | 35 --
.../extension-example/pom.xml | 35 --
.../encrypt-raw-jdbc-example/pom.xml | 42 --
.../jdbc/EncryptRawJavaConfigurationExample.java | 43 ---
.../jdbc/EncryptRawYamlConfigurationExample.java | 45 ---
.../jdbc/config/EncryptDatabasesConfiguration.java | 56 ---
.../main/resources/META-INF/encrypt-databases.yaml | 45 ---
.../src/main/resources/logback.xml | 34 --
.../encrypt-spring-boot-mybatis-example/pom.xml | 50 ---
.../mybatis/EncryptSpringBootMybatisExample.java | 41 --
.../src/main/resources/META-INF/mybatis-config.xml | 26 --
.../application-encrypt-databases.properties | 37 --
.../src/main/resources/application.properties | 20 -
.../src/main/resources/logback.xml | 36 --
.../pom.xml | 42 --
.../EncryptSpringNamespaceMybatisExample.java | 36 --
.../META-INF/application-encrypt-databases.xml | 75 ----
.../src/main/resources/logback.xml | 34 --
.../other-feature-example/encrypt-example/pom.xml | 38 --
.../pom.xml | 42 --
.../ShadowSpringNamespaceMybatisExample.java | 36 --
.../spring/namespace/mybatis/domain/OrderInfo.java | 34 --
.../namespace/mybatis/repository/ShadowMapper.java | 27 --
.../namespace/mybatis/service/ShadowService.java | 23 --
.../mybatis/service/impl/ShadowServiceImpl.java | 58 ---
.../META-INF/application-shadow-databases.xml | 95 -----
.../resources/META-INF/mappers/ShadowMapper.xml | 30 --
.../src/main/resources/logback.xml | 34 --
.../future-shadow-example/pom.xml | 35 --
.../hint-example/hint-raw-jdbc-example/pom.xml | 43 ---
.../example/hint/raw/jdbc/HintRawExample.java | 96 -----
.../example/hint/raw/jdbc/HintType.java | 23 --
.../hint/raw/jdbc/ModuloHintShardingAlgorithm.java | 49 ---
.../resources/META-INF/hint-databases-only.yaml | 55 ---
.../resources/META-INF/hint-databases-tables.yaml | 75 ----
.../main/resources/META-INF/hint-write-only.yaml | 46 ---
...e.shardingsphere.sharding.spi.ShardingAlgorithm | 18 -
.../src/main/resources/logback.xml | 34 --
.../other-feature-example/hint-example/pom.xml | 36 --
.../other-feature-example/pom.xml | 38 --
.../other-feature-example/shadow-example/pom.xml | 37 --
.../shadow-example/shadow-raw-jdbc-example/pom.xml | 43 ---
.../jdbc/ShadowRawJavaConfigurationExample.java | 49 ---
.../jdbc/ShadowRawYamlConfigurationExample.java | 46 ---
.../EncryptShadowDatabasesConfiguration.java | 72 ----
...writeSplittingShadowDatabasesConfiguration.java | 51 ---
.../jdbc/config/ShadowDatabasesConfiguration.java | 41 --
.../ShardingShadowDatabasesConfiguration.java | 78 ----
.../table/raw/jdbc/factory/DataSourceFactory.java | 45 ---
.../raw/jdbc/factory/YamlDataSourceFactory.java | 48 ---
.../META-INF/encrypt-shadow-databases.yaml | 61 ---
.../readwrite-splitting-shadow-databases.yaml | 61 ---
.../main/resources/META-INF/shadow-databases.yaml | 38 --
.../META-INF/sharding-shadow-databases.yaml | 81 ----
.../src/main/resources/logback.xml | 34 --
.../shadow-spring-boot-mybatis-example/pom.xml | 50 ---
.../mybatis/ShadowSpringBootMybatisExample.java | 41 --
.../src/main/resources/META-INF/mybatis-config.xml | 30 --
...application-encrypt-shadow-databases.properties | 47 ---
...readwrite-splitting-shadow-databases.properties | 51 ---
.../application-shadow-databases.properties | 34 --
...pplication-sharding-shadow-databases.properties | 60 ---
.../src/main/resources/application.properties | 23 --
.../src/main/resources/logback.xml | 36 --
.../pom.xml | 42 --
.../ShadowSpringNamespaceMybatisExample.java | 39 --
.../application-encrypt-shadow-databases.xml | 87 -----
...cation-readwrite-splitting-shadow-databases.xml | 97 -----
.../META-INF/application-shadow-databases.xml | 74 ----
.../application-sharding-shadow-databases.xml | 105 -----
.../src/main/resources/logback.xml | 34 --
examples/shardingsphere-jdbc-example/pom.xml | 39 --
.../sharding-example/pom.xml | 39 --
.../sharding-raw-jdbc-example/pom.xml | 42 --
.../jdbc/ShardingRawJavaConfigurationExample.java | 48 ---
.../ShardingRawJavaRangeConfigurationExample.java | 51 ---
.../jdbc/ShardingRawYamlConfigurationExample.java | 49 ---
.../ShardingRawYamlRangeConfigurationExample.java | 49 ---
.../config/ReadwriteSplittingConfiguration.java | 51 ---
...dingDatabasesAndTablesConfigurationPrecise.java | 83 ----
...ardingDatabasesAndTablesConfigurationRange.java | 81 ----
.../ShardingDatabasesConfigurationPrecise.java | 90 -----
.../ShardingDatabasesConfigurationRange.java | 83 ----
...dingReadwriteSplittingConfigurationPrecise.java | 96 -----
...ardingReadwriteSplittingConfigurationRange.java | 97 -----
.../config/ShardingTablesConfigurationPrecise.java | 78 ----
.../config/ShardingTablesConfigurationRange.java | 78 ----
.../raw/jdbc/factory/DataSourceFactory.java | 48 ---
.../raw/jdbc/factory/RangeDataSourceFactory.java | 48 ---
.../raw/jdbc/factory/YamlDataSourceFactory.java | 50 ---
.../jdbc/factory/YamlRangeDataSourceFactory.java | 50 ---
.../resources/META-INF/readwrite-splitting.yaml | 46 ---
.../META-INF/sharding-databases-range.yaml | 72 ----
.../META-INF/sharding-databases-tables-range.yaml | 77 ----
.../META-INF/sharding-databases-tables.yaml | 85 ----
.../resources/META-INF/sharding-databases.yaml | 77 ----
.../sharding-readwrite-splitting-range.yaml | 113 ------
.../META-INF/sharding-readwrite-splitting.yaml | 123 ------
.../resources/META-INF/sharding-tables-range.yaml | 63 ---
.../main/resources/META-INF/sharding-tables.yaml | 69 ----
.../src/main/resources/logback.xml | 34 --
.../sharding-spring-boot-jpa-example/pom.xml | 51 ---
.../boot/jpa/ShardingSpringBootJpaExample.java | 41 --
.../application-readwrite-splitting.properties | 41 --
...pplication-sharding-databases-tables.properties | 61 ---
.../application-sharding-databases.properties | 51 ---
...ication-sharding-readwrite-splitting.properties | 91 -----
.../application-sharding-tables.properties | 50 ---
.../src/main/resources/application.properties | 26 --
.../src/main/resources/logback.xml | 36 --
.../sharding-spring-boot-mybatis-example/pom.xml | 52 ---
.../mybatis/ShardingSpringBootMybatisExample.java | 41 --
.../src/main/resources/META-INF/mybatis-config.xml | 28 --
.../application-readwrite-splitting.properties | 41 --
...pplication-sharding-databases-tables.properties | 64 ---
.../application-sharding-databases.properties | 51 ---
...ication-sharding-readwrite-splitting.properties | 91 -----
.../application-sharding-tables.properties | 51 ---
.../src/main/resources/application.properties | 24 --
.../src/main/resources/logback.xml | 34 --
.../sharding-spring-namespace-jpa-example/pom.xml | 43 ---
.../jpa/ShardingSpringNamespaceJpaExample.java | 40 --
.../META-INF/application-readwrite-splitting.xml | 85 ----
.../application-sharding-databases-tables.xml | 121 ------
.../META-INF/application-sharding-databases.xml | 101 -----
.../application-sharding-readwrite-splitting.xml | 162 --------
.../META-INF/application-sharding-tables.xml | 101 -----
.../src/main/resources/logback.xml | 34 --
.../pom.xml | 43 ---
.../ShardingSpringNamespaceMybatisExample.java | 40 --
.../META-INF/application-readwrite-splitting.xml | 81 ----
.../application-sharding-databases-tables.xml | 114 ------
.../META-INF/application-sharding-databases.xml | 98 -----
.../application-sharding-readwrite-splitting.xml | 151 --------
.../META-INF/application-sharding-tables.xml | 101 -----
.../src/main/resources/logback.xml | 34 --
.../transaction-example/pom.xml | 42 --
.../pom.xml | 41 --
.../raw/jdbc/TransactionXaAtomikosRawExample.java | 31 --
.../xa/atomikos/raw/jdbc/XAOrderService.java | 131 -------
.../sharding-databases-tables-postgresql.yaml | 67 ----
.../META-INF/sharding-databases-tables.yaml | 70 ----
.../src/main/resources/logback.xml | 38 --
.../xa/atomikos/raw/jdbc/XAOrderServiceTest.java | 63 ---
.../sharding-databases-tables-postgresql.yaml | 67 ----
.../META-INF/sharding-databases-tables.yaml | 70 ----
.../pom.xml | 54 ---
.../xa/bitronix/raw/jdbc/OrderServiceImpl.java | 132 -------
.../raw/jdbc/TransactionXaBitronixRawExample.java | 44 ---
.../META-INF/sharding-databases-tables.yaml | 75 ----
.../src/main/resources/logback.xml | 38 --
.../pom.xml | 66 ----
.../xa/narayana/raw/jdbc/OrderServiceImpl.java | 133 -------
.../raw/jdbc/TransactionXaNarayanaRawExample.java | 45 ---
.../META-INF/sharding-databases-tables.yaml | 75 ----
.../src/main/resources/jbossts-properties.xml | 46 ---
.../src/main/resources/logback.xml | 38 --
.../transaction-2pc-xa-spring-boot-example/pom.xml | 50 ---
.../xa/spring/boot/TransactionConfiguration.java | 57 ---
.../boot/TransactionXaSpringBootExample.java | 44 ---
.../transaction/xa/spring/boot/XAOrderService.java | 106 -----
...pplication-sharding-databases-tables.properties | 47 ---
.../application-sharding-databases.properties | 43 ---
.../application-sharding-tables.properties | 36 --
.../src/main/resources/application.properties | 21 -
.../src/main/resources/logback.xml | 39 --
.../xa/spring/boot/XAOrderServiceTest.java | 73 ----
.../pom.xml | 54 ---
.../TransactionXaSpringNamespaceExample.java | 34 --
.../xa/spring/namspace/XAOrderService.java | 106 -----
.../application-sharding-databases-tables.xml | 104 -----
.../META-INF/application-sharding-databases.xml | 85 ----
.../META-INF/application-sharding-tables.xml | 82 ----
.../src/main/resources/logback.xml | 39 --
.../xa/spring/namspace/XAOrderServiceTest.java | 67 ----
.../pom.xml | 53 ---
.../base/seata/raw/jdbc/SeataATOrderService.java | 129 -------
.../raw/jdbc/TransactionBaseSeataRawExample.java | 41 --
.../META-INF/sharding-databases-tables.yaml | 69 ----
.../src/main/resources/logback.xml | 34 --
.../src/main/resources/seata.conf | 21 -
.../src/main/resources/sql/undo_log.sql | 33 --
.../seata/raw/jdbc/SeataATOrderServiceTest.java | 72 ----
.../pom.xml | 63 ---
.../seata/spring/boot/SeataATOrderService.java | 105 -----
.../TransactionBaseSeataSpringBootExample.java | 53 ---
.../spring/boot/TransactionConfiguration.java | 57 ---
...pplication-sharding-databases-tables.properties | 47 ---
.../application-sharding-databases.properties | 43 ---
.../application-sharding-tables.properties | 36 --
.../src/main/resources/application.properties | 20 -
.../src/main/resources/logback.xml | 34 --
.../src/main/resources/seata.conf | 21 -
.../src/main/resources/sql/undo_log.sql | 33 --
.../seata/spring/boot/SeataATOrderServiceTest.java | 82 ----
examples/shardingsphere-parser-example/pom.xml | 63 ---
.../mysql/format/MySQLParserFormatExample.java | 65 ----
.../statement/MySQLParserStatementExample.java | 63 ---
.../statement/OracleParserStatementExample.java | 61 ---
.../PostgreSQLParserStatementExample.java | 61 ---
.../statement/SQL92ParserStatementExample.java | 61 ---
.../statement/SQLServerParserStatementExample.java | 63 ---
examples/shardingsphere-proxy-example/pom.xml | 36 --
.../pom.xml | 43 ---
.../mybatis/ProxySpringBootStarterExample.java | 65 ----
.../src/main/resources/META-INF/mybatis-config.xml | 28 --
.../src/main/resources/application.properties | 24 --
.../resources/conf/config-readwrite-splitting.yaml | 63 ---
.../src/main/resources/conf/config-sharding.yaml | 97 -----
.../src/main/resources/conf/server.yaml | 54 ---
.../src/main/resources/logback.xml | 35 --
.../shardingsphere-proxy-hint-example/pom.xml | 47 ---
.../example/proxy/hint/HintType.java | 23 --
.../proxy/hint/ModuloHintShardingAlgorithm.java | 49 ---
.../example/proxy/hint/ProxyHintExample.java | 93 -----
.../proxy/hint/config/DatasourceConfiguration.java | 63 ---
.../proxy/hint/factory/YamlDataSourceFactory.java | 39 --
.../resources/META-INF/hint-databases-only.yaml | 21 -
.../resources/META-INF/hint-databases-tables.yaml | 21 -
.../main/resources/META-INF/hint-write-only.yaml | 21 -
...e.shardingsphere.sharding.spi.ShardingAlgorithm | 18 -
.../main/resources/conf/config-databases-only.yaml | 60 ---
.../resources/conf/config-databases-tables.yaml | 80 ----
.../src/main/resources/conf/config-write-only.yaml | 56 ---
.../src/main/resources/conf/server.yaml | 52 ---
.../src/main/resources/logback.xml | 34 --
examples/src/resources/manual_schema.sql | 88 -----
360 files changed, 20788 deletions(-)
diff --git a/examples/README.md b/examples/README.md
deleted file mode 100644
index ba872bc..0000000
--- a/examples/README.md
+++ /dev/null
@@ -1,96 +0,0 @@
-# ShardingSphere-example
-
-Example for 1.x please see tags in `https://github.com/apache/shardingsphere/tree/${tag}/shardingsphere-jdbc-example`
-
-Example for 2.x or 3.x or 4.x please see tags in `https://github.com/apache/shardingsphere-example/tree/${tag}`
-
-**Notices**
-
-- *Please do not use `dev` branch to run your example, example of `dev` branch is not released yet.*
-
-- *Please execute [initial script](https://github.com/apache/shardingsphere/blob/master/examples/src/resources/manual_schema.sql) before you first run the example if using manual mode.*
-
-- *Please make sure primary replica data replication sync on MySQL is running correctly. Otherwise, primary-replica example will query empty data from the replica.*
-
-## Using `master` branch
-
-Please make sure some dependencies from [Apache ShardingSphere](https://github.com/apache/shardingsphere) has been installed since examples depend on that.
-if you are a newbie for Apache ShardingSphere, you could prepare the dependencies as following:
-
-1. download and install [Apache ShardingSphere](https://github.com/apache/shardingsphere):
-
-```bash
-## download source code
-git clone https://github.com/apache/shardingsphere.git
-
-## compile source code
-cd shardingsphere
-mvn clean install -Prelease
-```
-
-## Module design
-
-### project structure
-
-```
-shardingsphere-example
- ├── example-core
- │ ├── config-utility
- │ ├── example-api
- │ ├── example-raw-jdbc
- │ ├── example-spring-jpa
- │ └── example-spring-mybatis
- ├── shardingsphere-jdbc-example
- │ ├── sharding-example
- │ │ ├── sharding-raw-jdbc-example
- │ │ ├── sharding-spring-boot-jpa-example
- │ │ ├── sharding-spring-boot-mybatis-example
- │ │ ├── sharding-spring-namespace-jpa-example
- │ │ └── sharding-spring-namespace-mybatis-example
- │ ├── governance-example
- │ │ ├── governance-raw-jdbc-example
- │ │ ├── governance-spring-boot-mybatis-example
- │ │ └── governance-spring-namespace-mybatis-example
- │ ├── transaction-example
- │ │ ├── transaction-2pc-xa-bitronix-raw-jdbc-example
- │ │ ├── transaction-2pc-xa-narayana-raw-jdbc-example
- │ │ ├── transaction-2pc-xa-atomikos-raw-jdbc-example
- │ │ ├── transaction-2pc-xa-spring-boot-example
- │ │ ├── transaction-2pc-xa-spring-namespace-example
- │ │ ├── transaction-base-seata-raw-jdbc-example
- │ │ └── transaction-base-seata-spring-boot-example
- │ ├── other-feature-example
- │ │ ├── encrypt-example
- │ │ │ ├── encrypt-raw-jdbc-example
- │ │ │ ├── encrypt-spring-boot-mybatis-example
- │ │ │ └── encrypt-spring-namespace-mybatis-example
- │ │ ├── hint-example
- │ │ │ └── hint-raw-jdbc-example
- │ │ └── shadow-example
- │ │ │ ├── shadow-raw-jdbc-example
- │ │ │ ├── shadow-spring-boot-mybatis-example
- │ │ │ └── shadow-spring-namespace-mybatis-example
- │ ├── extension-example
- │ │ └── custom-sharding-algortihm-example
- ├── shardingsphere-parser-example
- ├── shardingsphere-proxy-example
- │ ├── shardingsphere-proxy-boot-mybatis-example
- │ └── shardingsphere-proxy-hint-example
- └── src/resources
- └── manual_schema.sql
-```
-
-## Available Examples
-
-| Example | Description |
-|---------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------|
-| [sharding](shardingsphere-jdbc-example/sharding-example) | show how to use table sharding\database sharding\replica-query with ShardingSphere-JDBC |
-| [springboot jpa](shardingsphere-jdbc-example/sharding-example/sharding-spring-boot-jpa-example) | show how to use SpringBoot JPA with ShardingSphere-JDBC |
-| [springboot mybatis](shardingsphere-jdbc-example/sharding-example/sharding-spring-boot-mybatis-example) | show how to use SpringBoot Mybatis with ShardingSphere-JDBC |
-| [governance](shardingsphere-jdbc-example/governance-example) | show how to use ShardingSphere-JDBC governance |
-| [transaction](shardingsphere-jdbc-example/transaction-example) | show how to use ShardingSphere-JDBC transaction |
-| [hint](shardingsphere-jdbc-example/other-feature-example/hint-example) | show how to use ShardingSphere-JDBC hint |
-| [encryption](shardingsphere-jdbc-example/other-feature-example/encrypt-example) | show how to use ShardingSphere-JDBC encryption |
-| APM(Pending) | show how to use APM in ShardingSphere |
-| proxy(Pending) | show how to use ShardingSphere-Proxy |
-| [docker](./docker/docker-compose.md) | show how to use docker to setup the environment for ShardingSphere |
diff --git a/examples/README_ZH.md b/examples/README_ZH.md
deleted file mode 100644
index bd353f0..0000000
--- a/examples/README_ZH.md
+++ /dev/null
@@ -1,96 +0,0 @@
-# Apache ShardingSphere 示例
-
-1.x 版本示例,请参阅 `https://github.com/apache/shardingsphere/tree/${tag}/shardingsphere-jdbc-example`
-
-2.x,3.x 或 4.x 版本示例,请参见 `https://github.com/apache/shardingsphere-example/tree/${tag}`
-
-**注意事项**
-
-- *请不要使用 `dev` 分支来运行您的示例,`dev` 分支的示例尚未发布。*
-
-- *如果采用手动模式,请在首次运行示例之前执行[初始化脚本](https://github.com/apache/shardingsphere/blob/master/examples/src/resources/manual_schema.sql)。*
-
-- *请确保 MySQL 上的主从数据同步正确运行。否则,读写分离示例查询从库数据为空。*
-
-## 使用 `master` 分支
-
-请在开始该示例之前,请确保已安装了来自 [Apache ShardingSphere](https://github.com/apache/shardingsphere) 的全部依赖项。
-如果您是 ShardingSphere 的新手,您可以准备如下依赖:
-
-1. 下载并安装 [Apache ShardingSphere](https://github.com/apache/shardingsphere):
-
-```bash
-## 下载源码
-git clone https://github.com/apache/shardingsphere.git
-
-## 编译源码
-cd shardingsphere
-mvn clean install -Prelease
-```
-
-## 模块设计
-
-### 项目结构
-
-```
-shardingsphere-example
- ├── example-core
- │ ├── config-utility
- │ ├── example-api
- │ ├── example-raw-jdbc
- │ ├── example-spring-jpa
- │ └── example-spring-mybatis
- ├── shardingsphere-jdbc-example
- │ ├── sharding-example
- │ │ ├── sharding-raw-jdbc-example
- │ │ ├── sharding-spring-boot-jpa-example
- │ │ ├── sharding-spring-boot-mybatis-example
- │ │ ├── sharding-spring-namespace-jpa-example
- │ │ └── sharding-spring-namespace-mybatis-example
- │ ├── governance-example
- │ │ ├── governance-raw-jdbc-example
- │ │ ├── governance-spring-boot-mybatis-example
- │ │ └── governance-spring-namespace-mybatis-example
- │ ├── transaction-example
- │ │ ├── transaction-2pc-xa-bitronix-raw-jdbc-example
- │ │ ├── transaction-2pc-xa-narayana-raw-jdbc-example
- │ │ ├── transaction-2pc-xa-atomikos-raw-jdbc-example
- │ │ ├── transaction-2pc-xa-spring-boot-example
- │ │ ├── transaction-2pc-xa-spring-namespace-example
- │ │ ├── transaction-base-seata-raw-jdbc-example
- │ │ └── transaction-base-seata-spring-boot-example
- │ ├── other-feature-example
- │ │ ├── encrypt-example
- │ │ │ ├── encrypt-raw-jdbc-example
- │ │ │ ├── encrypt-spring-boot-mybatis-example
- │ │ │ └── encrypt-spring-namespace-mybatis-example
- │ │ ├── hint-example
- │ │ │ └── hint-raw-jdbc-example
- │ │ └── shadow-example
- │ │ │ ├── shadow-raw-jdbc-example
- │ │ │ ├── shadow-spring-boot-mybatis-example
- │ │ │ └── shadow-spring-namespace-mybatis-example
- │ ├── extension-example
- │ │ └── custom-sharding-algortihm-example
- ├── shardingsphere-parser-example
- ├── shardingsphere-proxy-example
- │ ├── shardingsphere-proxy-boot-mybatis-example
- │ └── shardingsphere-proxy-hint-example
- └── src/resources
- └── manual_schema.sql
-```
-
-## 用例列表
-
-| 例子 | 描述 |
-|--------------------------------------------------------------------------------------------------------|-------------------------------------------------------|
-| [分片](shardingsphere-jdbc-example/sharding-example) | 演示通过 ShardingSphere-JDBC 进行分库、分表、主从等 |
-| [springboot jpa](shardingsphere-jdbc-example/sharding-example/sharding-spring-boot-jpa-example) | 演示通过 SpringBoot JPA 对接 ShardingSphere-JDBC |
-| [springboot mybatis](shardingsphere-jdbc-example/sharding-example/sharding-spring-boot-mybatis-example) | 演示通过 SpringBoot Mybatis 对接 ShardingSphere-JDBC |
-| [治理](shardingsphere-jdbc-example/governance-example) | 演示在 ShardingSphere-JDBC 中使用治理 |
-| [事务](shardingsphere-jdbc-example/transaction-example) | 演示在 ShardingSphere-JDBC 中使用事务 |
-| [hint](shardingsphere-jdbc-example/other-feature-example/hint-example) | 演示在 ShardingSphere-JDBC 中使用 hint |
-| [加密](shardingsphere-jdbc-example/other-feature-example/encrypt-example) | 演示在 ShardingSphere-JDBC 中使用加密 |
-| APM监控(Pending) | 演示在 ShardingSphere 中使用 APM 监控 |
-| proxy(Pending) | 演示使用 ShardingSphere-Proxy |
-| [docker](./docker/docker-compose.md) | 演示通过 docker 创建 ShardingSphere 所依赖的环境 |
diff --git a/examples/docker/docker-compose-zh.md b/examples/docker/docker-compose-zh.md
deleted file mode 100644
index 6b89cfd..0000000
--- a/examples/docker/docker-compose-zh.md
+++ /dev/null
@@ -1,21 +0,0 @@
-## 使用docker-compose初始化开始环境
-
-在开始使用docker compose之前,根据下述参考网址安装docker和docker-compose:https://docs.docker.com/compose/install/
-
-#### ShardingSphere-JDBC
-
-1. 运行 'cd docker/shardingsphere-jdbc/sharding',进入 docker 文件夹
-2. 运行 'docker-compose up -d',启动 docker compose 环境
-3. 根据需要,开启 mysql/etcd/zookeeper
-4. 如果有端口冲突,在 docker-compose.yml 中修改相应的端口,然后再次使用 'docker-compose up -d' 启动 docker compose
-5. 如果需要关闭程序,请使用命令 'docker-compose down'
-
-#### ShardingSphere-Proxy
-
-1. 运行 'cd docker/shardingsphere-proxy/sharding',进入 docker 文件夹
-2. 运行 'docker-compose up -d',启动 docker compose 环境
-3. 运行 `mysql -h127.0.0.1 -P13308 -proot -uroot` 登录代理
-4. 如果有端口冲突,在docker-compose.yml中修改相应的端口,然后再次使用 'docker-compose up -d'启动docker compose
-5. 如果需要关闭程序,请使用命令 'docker-compose down'
-
-需要注意,请谨慎使用 docker 删除指令`docker ps -a -q`去删除docker容器。
diff --git a/examples/docker/docker-compose.md b/examples/docker/docker-compose.md
deleted file mode 100644
index 56c79d3..0000000
--- a/examples/docker/docker-compose.md
+++ /dev/null
@@ -1,21 +0,0 @@
-## Using docker-compose to config startup environment
-
-before we use docker compose, please install docker and docker-compose first : https://docs.docker.com/compose/install/
-
-#### ShardingSphere-JDBC
-
-1. access the docker folder (cd docker/shardingsphere-jdbc/sharding)
-2. launch the environment by docker compose (docker-compose up -d)
-3. access mysql / etcd / zookeeper as you want
-4. if there is conflict on port, just modify the corresponding port defined in docker-compose.yml and then launch docker compose again(docker-compose up -d)
-5. if you want to stop the environment, use command docker-compose down
-
-#### ShardingSphere-Proxy
-
-1. access the docker folder (cd docker/shardingsphere-proxy/sharding)
-2. launch the environment by docker compose (docker-compose up -d)
-3. access proxy by `mysql -h127.0.0.1 -P13308 -proot -uroot`
-4. if there is conflict on port, just modify the corresponding port defined in docker-compose.yml and then launch docker compose again(docker-compose up -d)
-5. if you want to stop the environment, use command docker-compose down
-
-to clean the docker container , you could use docker rm `docker ps -a -q` (be careful)
diff --git a/examples/docker/shardingsphere-jdbc/sharding/docker-compose.yml b/examples/docker/shardingsphere-jdbc/sharding/docker-compose.yml
deleted file mode 100644
index 1e7b7f6..0000000
--- a/examples/docker/shardingsphere-jdbc/sharding/docker-compose.yml
+++ /dev/null
@@ -1,60 +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.
-#
-
-version: '3'
-services:
- mysql:
- ## for different MySQL version, you could get more at here : https://hub.docker.com/_/mysql?tab=tags
- image: "mysql:5.7"
- ## port binding to 3306, you could change to 13306:3306 or any other available port you want
- ports:
- - "3306:3306"
- container_name: shardingsphere-example-mysql
- ## launch MySQL without password
- ## you could access MySQL like `mysql -h127.0.0.1 -P3306 -uroot`
- ## if you insist to access MySQL with password, remove `MYSQL_ALLOW_EMPTY_PASSWORD=yes` and then use MYSQL_ROOT_PASSWORD argument
- # - MYSQL_ROOT_PASSWORD=root
- environment:
- - MYSQL_ALLOW_EMPTY_PASSWORD=yes
- ## copy the manual_schema.sql to /docker-entrypoint-initdb.d/ . this will init the sql file when the MySQL in container start up
- volumes:
- - ../../../src/resources/manual_schema.sql:/docker-entrypoint-initdb.d/manual_schema.sql
-
- zookeeper:
- ## get more versions of zookeeper here : https://hub.docker.com/_/zookeeper?tab=tags
- image: "zookeeper:3.4"
- ports:
- - "2181:2181"
- container_name: shardingsphere-example-zookeeper
-
- etcd:
- ## get more versions of etcd here : https://quay.io/repository/coreos/etcd?tag=latest&tab=tags
- image: "quay.io/coreos/etcd:v3.3.12"
- ports:
- - "2379:2379"
- - "2380:2380"
- - "4001:4001"
- container_name: shardingsphere-example-etcd
- entrypoint: /usr/local/bin/etcd
- command:
- - '--advertise-client-urls=http://0.0.0.0:2379'
- - '--listen-client-urls=http://0.0.0.0:2379'
- - '--initial-advertise-peer-urls=http://0.0.0.0:2380'
- - '--listen-peer-urls=http://0.0.0.0:2380'
- - '--initial-cluster'
- - 'default=http://0.0.0.0:2380'
-
diff --git a/examples/docker/shardingsphere-proxy/governance/docker-compose.yml b/examples/docker/shardingsphere-proxy/governance/docker-compose.yml
deleted file mode 100644
index 7acfd46..0000000
--- a/examples/docker/shardingsphere-proxy/governance/docker-compose.yml
+++ /dev/null
@@ -1,42 +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.
-#
-
-version: '3'
-services:
- zookeeper:
- ## get more versions of zookeeper here : https://hub.docker.com/_/zookeeper?tab=tags
- image: "zookeeper:3.4"
- ports:
- - "2181:2181"
- container_name: shardingsphere-example-zookeeper
-
- etcd:
- ## get more versions of etcd here : https://quay.io/repository/coreos/etcd?tag=latest&tab=tags
- image: "quay.io/coreos/etcd:v3.3.12"
- ports:
- - "2379:2379"
- - "2380:2380"
- - "4001:4001"
- container_name: shardingsphere-example-etcd
- entrypoint: /usr/local/bin/etcd
- command:
- - '--advertise-client-urls=http://0.0.0.0:2379'
- - '--listen-client-urls=http://0.0.0.0:2379'
- - '--initial-advertise-peer-urls=http://0.0.0.0:2380'
- - '--listen-peer-urls=http://0.0.0.0:2380'
- - '--initial-cluster'
- - 'default=http://0.0.0.0:2380'
diff --git a/examples/docker/shardingsphere-proxy/governance/run.sh b/examples/docker/shardingsphere-proxy/governance/run.sh
deleted file mode 100644
index 235d08e..0000000
--- a/examples/docker/shardingsphere-proxy/governance/run.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-#
-
-docker-compose up -d
diff --git a/examples/docker/shardingsphere-proxy/governance/stop.sh b/examples/docker/shardingsphere-proxy/governance/stop.sh
deleted file mode 100644
index fcf30fd..0000000
--- a/examples/docker/shardingsphere-proxy/governance/stop.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-#
-
-docker-compose down
diff --git a/examples/docker/shardingsphere-proxy/sharding/conf/config-sharding.yaml b/examples/docker/shardingsphere-proxy/sharding/conf/config-sharding.yaml
deleted file mode 100644
index fab3f67..0000000
--- a/examples/docker/shardingsphere-proxy/sharding/conf/config-sharding.yaml
+++ /dev/null
@@ -1,83 +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.
-#
-
-######################################################################################################
-#
-# Here you can configure the rules for the proxy.
-# This example is configuration of sharding rule.
-#
-######################################################################################################
-
-schemaName: sharding_db
-
-dataSources:
- ds_0:
- url: jdbc:mysql://shardingsphere-example-mysql:3306/demo_ds_0?serverTimezone=UTC&useSSL=false
- username: root
- password:
- connectionTimeoutMilliseconds: 30000
- idleTimeoutMilliseconds: 60000
- maxLifetimeMilliseconds: 1800000
- maxPoolSize: 50
- ds_1:
- url: jdbc:mysql://shardingsphere-example-mysql:3306/demo_ds_1?serverTimezone=UTC&useSSL=false
- username: root
- password:
- connectionTimeoutMilliseconds: 30000
- idleTimeoutMilliseconds: 60000
- maxLifetimeMilliseconds: 1800000
- maxPoolSize: 50
-
-rules:
-- !SHARDING
- tables:
- t_order:
- actualDataNodes: ds_${0..1}.t_order_${0..1}
- tableStrategy:
- standard:
- shardingColumn: order_id
- shardingAlgorithmName: t_order_inline
- keyGeneratorColumnName: order_id
- t_order_item:
- actualDataNodes: ds_${0..1}.t_order_item_${0..1}
- tableStrategy:
- standard:
- shardingColumn: order_id
- shardingAlgorithmName: t_order_item_inline
- keyGeneratorColumnName: order_item_id
- bindingTables:
- - t_order,t_order_item
- defaultDatabaseStrategy:
- standard:
- shardingColumn: user_id
- shardingAlgorithmName: database_inline
- defaultTableStrategy:
- none:
-
- shardingAlgorithms:
- database_inline:
- type: INLINE
- props:
- algorithm-expression: ds_${user_id % 2}
- t_order_inline:
- type: INLINE
- props:
- algorithm-expression: t_order_${order_id % 2}
- t_order_item_inline:
- type: INLINE
- props:
- algorithm-expression: t_order_item_${order_id % 2}
diff --git a/examples/docker/shardingsphere-proxy/sharding/conf/server.yaml b/examples/docker/shardingsphere-proxy/sharding/conf/server.yaml
deleted file mode 100644
index e6010dc..0000000
--- a/examples/docker/shardingsphere-proxy/sharding/conf/server.yaml
+++ /dev/null
@@ -1,45 +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.
-#
-
-######################################################################################################
-#
-# If you want to configure governance, authorization and proxy properties, please refer to this file.
-#
-######################################################################################################
-
-#mode:
-# type: Cluster
-# repository:
-# type: ZooKeeper
-# props:
-# namespace: governance_ds
-# serverLists: localhost:2181
-# overwrite: false
-
-rules:
- - !AUTHORITY
- users:
- - root@%:root
- provider:
- type: NATIVE
-
-props:
- max-connections-size-per-query: 1
- executor-size: 16 # Infinite by default.
- proxy-frontend-flush-threshold: 128 # The default value is 128.
- proxy-opentracing-enabled: false
- sql-show: false
diff --git a/examples/docker/shardingsphere-proxy/sharding/docker-compose.yml b/examples/docker/shardingsphere-proxy/sharding/docker-compose.yml
deleted file mode 100644
index 472e76e..0000000
--- a/examples/docker/shardingsphere-proxy/sharding/docker-compose.yml
+++ /dev/null
@@ -1,58 +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.
-#
-
-version: '3'
-services:
- mysql:
- ## for different MySQL version, you could get more at here : https://hub.docker.com/_/mysql?tab=tags
- image: "mysql:5.7"
- ## port binding to 3306, you could change to 13306:3306 or any other available port you want
- ports:
- - "3306:3306"
- container_name: shardingsphere-example-mysql
- ## launch MySQL without password
- ## you could access MySQL like `mysql -h127.0.0.1 -P3306 -uroot`
- ## if you insist to access MySQL with password, remove `MYSQL_ALLOW_EMPTY_PASSWORD=yes` and then use MYSQL_ROOT_PASSWORD argument
- # - MYSQL_ROOT_PASSWORD=root
- environment:
- - MYSQL_ALLOW_EMPTY_PASSWORD=yes
- ## copy the manual_schema.sql to /docker-entrypoint-initdb.d/ . this will init the sql file when the MySQL in container start up
- volumes:
- - ../../../src/resources/manual_schema.sql:/docker-entrypoint-initdb.d/manual_schema.sql
-
- proxy:
- ## get more versions of proxy here : https://hub.docker.com/r/apache/sharding-proxy/tags
- image: "apache/sharding-proxy:4.1.1"
- container_name: shardingsphere-example-proxy
- depends_on:
- - mysql
- ## wait-for-it.sh will make proxy entry point wait until MySQL container 3306 port open
- entrypoint: >
- /bin/sh -c "/opt/wait-for-it.sh shardingsphere-example-mysql:3306 --timeout=20 --strict --
- && /opt/sharding-proxy/bin/start.sh 3308
- && tail -f /opt/sharding-proxy/logs/stdout.log"
- ports:
- - "3308:3308"
- links:
- - "mysql:mysql"
- volumes:
- - ./conf/:/opt/sharding-proxy/conf
- - ../../tools/wait-for-it.sh:/opt/wait-for-it.sh
- environment:
- - JVM_OPTS="-Djava.awt.headless=true"
-
-
diff --git a/examples/docker/tools/wait-for-it.sh b/examples/docker/tools/wait-for-it.sh
deleted file mode 100644
index b4bf36b..0000000
--- a/examples/docker/tools/wait-for-it.sh
+++ /dev/null
@@ -1,195 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-#
-
-# Use this script to test if a given TCP host/port are available
-
-WAITFORIT_cmdname=${0##*/}
-
-echoerr() { if [[ $WAITFORIT_QUIET -ne 1 ]]; then echo "$@" 1>&2; fi }
-
-usage()
-{
- cat << USAGE >&2
-Usage:
- $WAITFORIT_cmdname host:port [-s] [-t timeout] [-- command args]
- -h HOST | --host=HOST Host or IP under test
- -p PORT | --port=PORT TCP port under test
- Alternatively, you specify the host and port as host:port
- -s | --strict Only execute subcommand if the test succeeds
- -q | --quiet Don't output any status messages
- -t TIMEOUT | --timeout=TIMEOUT
- Timeout in seconds, zero for no timeout
- -- COMMAND ARGS Execute command with args after the test finishes
-USAGE
- exit 1
-}
-
-wait_for()
-{
- if [[ $WAITFORIT_TIMEOUT -gt 0 ]]; then
- echoerr "$WAITFORIT_cmdname: waiting $WAITFORIT_TIMEOUT seconds for $WAITFORIT_HOST:$WAITFORIT_PORT"
- else
- echoerr "$WAITFORIT_cmdname: waiting for $WAITFORIT_HOST:$WAITFORIT_PORT without a timeout"
- fi
- WAITFORIT_start_ts=$(date +%s)
- while :
- do
- if [[ $WAITFORIT_ISBUSY -eq 1 ]]; then
- nc -z $WAITFORIT_HOST $WAITFORIT_PORT
- WAITFORIT_result=$?
- else
- (echo > /dev/tcp/$WAITFORIT_HOST/$WAITFORIT_PORT) >/dev/null 2>&1
- WAITFORIT_result=$?
- fi
- if [[ $WAITFORIT_result -eq 0 ]]; then
- WAITFORIT_end_ts=$(date +%s)
- echoerr "$WAITFORIT_cmdname: $WAITFORIT_HOST:$WAITFORIT_PORT is available after $((WAITFORIT_end_ts - WAITFORIT_start_ts)) seconds"
- break
- fi
- sleep 1
- done
- return $WAITFORIT_result
-}
-
-wait_for_wrapper()
-{
- # In order to support SIGINT during timeout: http://unix.stackexchange.com/a/57692
- if [[ $WAITFORIT_QUIET -eq 1 ]]; then
- timeout $WAITFORIT_BUSYTIMEFLAG $WAITFORIT_TIMEOUT $0 --quiet --child --host=$WAITFORIT_HOST --port=$WAITFORIT_PORT --timeout=$WAITFORIT_TIMEOUT &
- else
- timeout $WAITFORIT_BUSYTIMEFLAG $WAITFORIT_TIMEOUT $0 --child --host=$WAITFORIT_HOST --port=$WAITFORIT_PORT --timeout=$WAITFORIT_TIMEOUT &
- fi
- WAITFORIT_PID=$!
- trap "kill -INT -$WAITFORIT_PID" INT
- wait $WAITFORIT_PID
- WAITFORIT_RESULT=$?
- if [[ $WAITFORIT_RESULT -ne 0 ]]; then
- echoerr "$WAITFORIT_cmdname: timeout occurred after waiting $WAITFORIT_TIMEOUT seconds for $WAITFORIT_HOST:$WAITFORIT_PORT"
- fi
- return $WAITFORIT_RESULT
-}
-
-# process arguments
-while [[ $# -gt 0 ]]
-do
- case "$1" in
- *:* )
- WAITFORIT_hostport=(${1//:/ })
- WAITFORIT_HOST=${WAITFORIT_hostport[0]}
- WAITFORIT_PORT=${WAITFORIT_hostport[1]}
- shift 1
- ;;
- --child)
- WAITFORIT_CHILD=1
- shift 1
- ;;
- -q | --quiet)
- WAITFORIT_QUIET=1
- shift 1
- ;;
- -s | --strict)
- WAITFORIT_STRICT=1
- shift 1
- ;;
- -h)
- WAITFORIT_HOST="$2"
- if [[ $WAITFORIT_HOST == "" ]]; then break; fi
- shift 2
- ;;
- --host=*)
- WAITFORIT_HOST="${1#*=}"
- shift 1
- ;;
- -p)
- WAITFORIT_PORT="$2"
- if [[ $WAITFORIT_PORT == "" ]]; then break; fi
- shift 2
- ;;
- --port=*)
- WAITFORIT_PORT="${1#*=}"
- shift 1
- ;;
- -t)
- WAITFORIT_TIMEOUT="$2"
- if [[ $WAITFORIT_TIMEOUT == "" ]]; then break; fi
- shift 2
- ;;
- --timeout=*)
- WAITFORIT_TIMEOUT="${1#*=}"
- shift 1
- ;;
- --)
- shift
- WAITFORIT_CLI=("$@")
- break
- ;;
- --help)
- usage
- ;;
- *)
- echoerr "Unknown argument: $1"
- usage
- ;;
- esac
-done
-
-if [[ "$WAITFORIT_HOST" == "" || "$WAITFORIT_PORT" == "" ]]; then
- echoerr "Error: you need to provide a host and port to test."
- usage
-fi
-
-WAITFORIT_TIMEOUT=${WAITFORIT_TIMEOUT:-15}
-WAITFORIT_STRICT=${WAITFORIT_STRICT:-0}
-WAITFORIT_CHILD=${WAITFORIT_CHILD:-0}
-WAITFORIT_QUIET=${WAITFORIT_QUIET:-0}
-
-# check to see if timeout is from busybox?
-WAITFORIT_TIMEOUT_PATH=$(type -p timeout)
-WAITFORIT_TIMEOUT_PATH=$(realpath $WAITFORIT_TIMEOUT_PATH 2>/dev/null || readlink -f $WAITFORIT_TIMEOUT_PATH)
-if [[ $WAITFORIT_TIMEOUT_PATH =~ "busybox" ]]; then
- WAITFORIT_ISBUSY=1
- WAITFORIT_BUSYTIMEFLAG="-t"
-
-else
- WAITFORIT_ISBUSY=0
- WAITFORIT_BUSYTIMEFLAG=""
-fi
-
-if [[ $WAITFORIT_CHILD -gt 0 ]]; then
- wait_for
- WAITFORIT_RESULT=$?
- exit $WAITFORIT_RESULT
-else
- if [[ $WAITFORIT_TIMEOUT -gt 0 ]]; then
- wait_for_wrapper
- WAITFORIT_RESULT=$?
- else
- wait_for
- WAITFORIT_RESULT=$?
- fi
-fi
-
-if [[ $WAITFORIT_CLI != "" ]]; then
- if [[ $WAITFORIT_RESULT -ne 0 && $WAITFORIT_STRICT -eq 1 ]]; then
- echoerr "$WAITFORIT_cmdname: strict mode, refusing to execute subprocess"
- exit $WAITFORIT_RESULT
- fi
- exec "${WAITFORIT_CLI[@]}"
-else
- exit $WAITFORIT_RESULT
-fi
diff --git a/examples/example-core/config-utility/pom.xml b/examples/example-core/config-utility/pom.xml
deleted file mode 100644
index 0717000..0000000
--- a/examples/example-core/config-utility/pom.xml
+++ /dev/null
@@ -1,41 +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>example-core</artifactId>
- <version>5.0.0-RC1-SNAPSHOT</version>
- </parent>
- <artifactId>config-utility</artifactId>
- <name>${project.artifactId}</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-sharding-core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-encrypt-core</artifactId>
- </dependency>
- </dependencies>
-</project>
diff --git a/examples/example-core/config-utility/src/main/java/org/apache/shardingsphere/example/algorithm/StandardModuloShardingDatabaseAlgorithm.java b/examples/example-core/config-utility/src/main/java/org/apache/shardingsphere/example/algorithm/StandardModuloShardingDatabaseAlgorithm.java
deleted file mode 100644
index 301517c..0000000
--- a/examples/example-core/config-utility/src/main/java/org/apache/shardingsphere/example/algorithm/StandardModuloShardingDatabaseAlgorithm.java
+++ /dev/null
@@ -1,72 +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.algorithm;
-
-import com.google.common.collect.Range;
-import org.apache.shardingsphere.sharding.api.sharding.standard.PreciseShardingValue;
-import org.apache.shardingsphere.sharding.api.sharding.standard.RangeShardingValue;
-import org.apache.shardingsphere.sharding.api.sharding.standard.StandardShardingAlgorithm;
-
-import java.util.Collection;
-import java.util.LinkedHashSet;
-import java.util.Set;
-
-public final class StandardModuloShardingDatabaseAlgorithm implements StandardShardingAlgorithm<Integer> {
-
- @Override
- public void init() {
- }
-
- @Override
- public String doSharding(final Collection<String> databaseNames, final PreciseShardingValue<Integer> shardingValue) {
- for (String each : databaseNames) {
- if (each.endsWith(String.valueOf(shardingValue.getValue() % 2))) {
- return each;
- }
- }
- throw new UnsupportedOperationException("");
- }
-
- @Override
- public Collection<String> doSharding(final Collection<String> databaseNames, final RangeShardingValue<Integer> shardingValueRange) {
- Set<String> result = new LinkedHashSet<>();
- if (Range.closed(1, 5).encloses(shardingValueRange.getValueRange())) {
- for (String each : databaseNames) {
- if (each.endsWith("0")) {
- result.add(each);
- }
- }
- } else if (Range.closed(6, 10).encloses(shardingValueRange.getValueRange())) {
- for (String each : databaseNames) {
- if (each.endsWith("1")) {
- result.add(each);
- }
- }
- } else if (Range.closed(1, 10).encloses(shardingValueRange.getValueRange())) {
- result.addAll(databaseNames);
- } else {
- throw new UnsupportedOperationException("");
- }
- return result;
- }
-
- @Override
- public String getType() {
- return "STANDARD_TEST_DB";
- }
-}
diff --git a/examples/example-core/config-utility/src/main/java/org/apache/shardingsphere/example/algorithm/StandardModuloShardingTableAlgorithm.java b/examples/example-core/config-utility/src/main/java/org/apache/shardingsphere/example/algorithm/StandardModuloShardingTableAlgorithm.java
deleted file mode 100644
index 255c50d..0000000
--- a/examples/example-core/config-utility/src/main/java/org/apache/shardingsphere/example/algorithm/StandardModuloShardingTableAlgorithm.java
+++ /dev/null
@@ -1,64 +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.algorithm;
-
-import com.google.common.collect.Range;
-import org.apache.shardingsphere.sharding.api.sharding.standard.PreciseShardingValue;
-import org.apache.shardingsphere.sharding.api.sharding.standard.RangeShardingValue;
-import org.apache.shardingsphere.sharding.api.sharding.standard.StandardShardingAlgorithm;
-
-import java.util.Collection;
-import java.util.LinkedHashSet;
-import java.util.Set;
-
-public final class StandardModuloShardingTableAlgorithm implements StandardShardingAlgorithm<Long> {
-
- @Override
- public void init() {
- }
-
- @Override
- public String doSharding(final Collection<String> tableNames, final PreciseShardingValue<Long> shardingValue) {
- for (String each : tableNames) {
- if (each.endsWith(String.valueOf(shardingValue.getValue() % 2))) {
- return each;
- }
- }
- throw new UnsupportedOperationException("");
- }
-
- @Override
- public Collection<String> doSharding(final Collection<String> tableNames, final RangeShardingValue<Long> shardingValue) {
- Set<String> result = new LinkedHashSet<>();
- if (Range.closed(200000000000000000L, 400000000000000000L).encloses(shardingValue.getValueRange())) {
- for (String each : tableNames) {
- if (each.endsWith("0")) {
- result.add(each);
- }
- }
- } else {
- throw new UnsupportedOperationException("");
- }
- return result;
- }
-
- @Override
- public String getType() {
- return "STANDARD_TEST_TBL";
- }
-}
diff --git a/examples/example-core/config-utility/src/main/java/org/apache/shardingsphere/example/config/ExampleConfiguration.java b/examples/example-core/config-utility/src/main/java/org/apache/shardingsphere/example/config/ExampleConfiguration.java
deleted file mode 100644
index f976057..0000000
--- a/examples/example-core/config-utility/src/main/java/org/apache/shardingsphere/example/config/ExampleConfiguration.java
+++ /dev/null
@@ -1,26 +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.config;
-
-import javax.sql.DataSource;
-import java.sql.SQLException;
-
-public interface ExampleConfiguration {
-
- DataSource getDataSource() throws SQLException;
-}
diff --git a/examples/example-core/config-utility/src/main/java/org/apache/shardingsphere/example/fixture/TestQueryAssistedShardingEncryptAlgorithm.java b/examples/example-core/config-utility/src/main/java/org/apache/shardingsphere/example/fixture/TestQueryAssistedShardingEncryptAlgorithm.java
deleted file mode 100644
index aea7814..0000000
--- a/examples/example-core/config-utility/src/main/java/org/apache/shardingsphere/example/fixture/TestQueryAssistedShardingEncryptAlgorithm.java
+++ /dev/null
@@ -1,54 +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.fixture;
-
-import org.apache.shardingsphere.encrypt.spi.QueryAssistedEncryptAlgorithm;
-import lombok.Getter;
-import lombok.Setter;
-import java.util.Properties;
-
-public final class TestQueryAssistedShardingEncryptAlgorithm implements QueryAssistedEncryptAlgorithm {
-
- @Getter
- @Setter
- private Properties props;
-
- @Override
- public void init() {
- }
-
- @Override
- public String encrypt(final Object plaintext) {
- return "encryptValue";
- }
-
- @Override
- public Object decrypt(final String ciphertext) {
- return "decryptValue";
- }
-
- @Override
- public String queryAssistedEncrypt(final String plaintext) {
- return "assistedEncryptValue";
- }
-
- @Override
- public String getType() {
- return "assistedTest";
- }
-}
diff --git a/examples/example-core/config-utility/src/main/java/org/apache/shardingsphere/example/type/RegistryCenterType.java b/examples/example-core/config-utility/src/main/java/org/apache/shardingsphere/example/type/RegistryCenterType.java
deleted file mode 100644
index e6f1ee2..0000000
--- a/examples/example-core/config-utility/src/main/java/org/apache/shardingsphere/example/type/RegistryCenterType.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.type;
-
-public enum RegistryCenterType {
-
- ZOOKEEPER, NACOS
-}
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
deleted file mode 100644
index d47554b..0000000
--- a/examples/example-core/config-utility/src/main/java/org/apache/shardingsphere/example/type/ShardingType.java
+++ /dev/null
@@ -1,41 +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.type;
-
-public enum ShardingType {
-
- SHARDING_DATABASES,
-
- SHARDING_TABLES,
-
- SHARDING_DATABASES_AND_TABLES,
-
- SHARDING_SHADOW_DATABASES,
-
- ENCRYPT_SHADOW,
-
- READWRITE_SPLITTING,
-
- READWRITE_SPLITTING_SHADOW,
-
- SHARDING_READWRITE_SPLITTING,
-
- ENCRYPT,
-
- SHADOW
-}
diff --git a/examples/example-core/config-utility/src/main/resources/META-INF/services/org.apache.shardingsphere.encrypt.spi.EncryptAlgorithm b/examples/example-core/config-utility/src/main/resources/META-INF/services/org.apache.shardingsphere.encrypt.spi.EncryptAlgorithm
deleted file mode 100644
index 39a143c..0000000
--- a/examples/example-core/config-utility/src/main/resources/META-INF/services/org.apache.shardingsphere.encrypt.spi.EncryptAlgorithm
+++ /dev/null
@@ -1,18 +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.
-#
-
-org.apache.shardingsphere.example.fixture.TestQueryAssistedShardingEncryptAlgorithm
\ No newline at end of file
diff --git a/examples/example-core/config-utility/src/main/resources/META-INF/services/org.apache.shardingsphere.sharding.spi.ShardingAlgorithm b/examples/example-core/config-utility/src/main/resources/META-INF/services/org.apache.shardingsphere.sharding.spi.ShardingAlgorithm
deleted file mode 100644
index 82f134b..0000000
--- a/examples/example-core/config-utility/src/main/resources/META-INF/services/org.apache.shardingsphere.sharding.spi.ShardingAlgorithm
+++ /dev/null
@@ -1,19 +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.
-#
-
-org.apache.shardingsphere.example.algorithm.StandardModuloShardingTableAlgorithm
-org.apache.shardingsphere.example.algorithm.StandardModuloShardingDatabaseAlgorithm
diff --git a/examples/example-core/example-api/pom.xml b/examples/example-core/example-api/pom.xml
deleted file mode 100644
index eea33f4..0000000
--- a/examples/example-core/example-api/pom.xml
+++ /dev/null
@@ -1,30 +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>example-core</artifactId>
- <version>5.0.0-RC1-SNAPSHOT</version>
- </parent>
- <artifactId>example-api</artifactId>
- <name>${project.artifactId}</name>
-</project>
diff --git a/examples/example-core/example-api/src/main/java/org/apache/shardingsphere/example/core/api/DataSourceUtil.java b/examples/example-core/example-api/src/main/java/org/apache/shardingsphere/example/core/api/DataSourceUtil.java
deleted file mode 100644
index 75a6ec9..0000000
--- a/examples/example-core/example-api/src/main/java/org/apache/shardingsphere/example/core/api/DataSourceUtil.java
+++ /dev/null
@@ -1,42 +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.core.api;
-
-import com.zaxxer.hikari.HikariDataSource;
-
-import javax.sql.DataSource;
-
-public final class DataSourceUtil {
-
- private static final String HOST = "localhost";
-
- private static final int PORT = 3306;
-
- private static final String USER_NAME = "root";
-
- private static final String PASSWORD = "";
-
- public static DataSource createDataSource(final String dataSourceName) {
- HikariDataSource result = new HikariDataSource();
- result.setDriverClassName("com.mysql.jdbc.Driver");
- result.setJdbcUrl(String.format("jdbc:mysql://%s:%s/%s?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8", HOST, PORT, dataSourceName));
- result.setUsername(USER_NAME);
- result.setPassword(PASSWORD);
- return result;
- }
-}
diff --git a/examples/example-core/example-api/src/main/java/org/apache/shardingsphere/example/core/api/ExampleExecuteTemplate.java b/examples/example-core/example-api/src/main/java/org/apache/shardingsphere/example/core/api/ExampleExecuteTemplate.java
deleted file mode 100644
index 93efe77..0000000
--- a/examples/example-core/example-api/src/main/java/org/apache/shardingsphere/example/core/api/ExampleExecuteTemplate.java
+++ /dev/null
@@ -1,43 +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.core.api;
-
-import org.apache.shardingsphere.example.core.api.service.ExampleService;
-
-import java.sql.SQLException;
-
-public final class ExampleExecuteTemplate {
-
- public static void run(final ExampleService exampleService) throws SQLException {
- try {
- exampleService.initEnvironment();
- exampleService.processSuccess();
- } finally {
- exampleService.cleanEnvironment();
- }
- }
-
- public static void runFailure(final ExampleService exampleService) throws SQLException {
- try {
- exampleService.initEnvironment();
- exampleService.processFailure();
- } finally {
- exampleService.cleanEnvironment();
- }
- }
-}
diff --git a/examples/example-core/example-api/src/main/java/org/apache/shardingsphere/example/core/api/entity/Address.java b/examples/example-core/example-api/src/main/java/org/apache/shardingsphere/example/core/api/entity/Address.java
deleted file mode 100644
index fca3e5f..0000000
--- a/examples/example-core/example-api/src/main/java/org/apache/shardingsphere/example/core/api/entity/Address.java
+++ /dev/null
@@ -1,45 +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.core.api.entity;
-
-import java.io.Serializable;
-
-public class Address implements Serializable {
-
- private static final long serialVersionUID = 661434701950670670L;
-
- private Long addressId;
-
- private String addressName;
-
- public Long getAddressId() {
- return addressId;
- }
-
- public void setAddressId(final Long addressId) {
- this.addressId = addressId;
- }
-
- public String getAddressName() {
- return addressName;
- }
-
- public void setAddressName(final String addressName) {
- this.addressName = addressName;
- }
-}
diff --git a/examples/example-core/example-api/src/main/java/org/apache/shardingsphere/example/core/api/entity/Order.java b/examples/example-core/example-api/src/main/java/org/apache/shardingsphere/example/core/api/entity/Order.java
deleted file mode 100644
index f171ca3..0000000
--- a/examples/example-core/example-api/src/main/java/org/apache/shardingsphere/example/core/api/entity/Order.java
+++ /dev/null
@@ -1,70 +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.core.api.entity;
-
-import java.io.Serializable;
-
-public class Order implements Serializable {
-
- private static final long serialVersionUID = 661434701950670670L;
-
- private long orderId;
-
- private int userId;
-
- private long addressId;
-
- private String status;
-
- public long getOrderId() {
- return orderId;
- }
-
- public void setOrderId(final long orderId) {
- this.orderId = orderId;
- }
-
- public int getUserId() {
- return userId;
- }
-
- public void setUserId(final int userId) {
- this.userId = userId;
- }
-
- public String getStatus() {
- return status;
- }
-
- public void setStatus(final String status) {
- this.status = status;
- }
-
- public long getAddressId() {
- return addressId;
- }
-
- public void setAddressId(final long addressId) {
- this.addressId = addressId;
- }
-
- @Override
- public String toString() {
- return String.format("order_id: %s, user_id: %s, address_id: %s, status: %s", orderId, userId, addressId, status);
- }
-}
diff --git a/examples/example-core/example-api/src/main/java/org/apache/shardingsphere/example/core/api/entity/OrderItem.java b/examples/example-core/example-api/src/main/java/org/apache/shardingsphere/example/core/api/entity/OrderItem.java
deleted file mode 100644
index ea21cfc..0000000
--- a/examples/example-core/example-api/src/main/java/org/apache/shardingsphere/example/core/api/entity/OrderItem.java
+++ /dev/null
@@ -1,70 +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.core.api.entity;
-
-import java.io.Serializable;
-
-public class OrderItem implements Serializable {
-
- private static final long serialVersionUID = 263434701950670170L;
-
- private long orderItemId;
-
- private long orderId;
-
- private int userId;
-
- private String status;
-
- public long getOrderItemId() {
- return orderItemId;
- }
-
- public void setOrderItemId(final long orderItemId) {
- this.orderItemId = orderItemId;
- }
-
- public long getOrderId() {
- return orderId;
- }
-
- public void setOrderId(final long orderId) {
- this.orderId = orderId;
- }
-
- public int getUserId() {
- return userId;
- }
-
- public void setUserId(final int userId) {
- this.userId = userId;
- }
-
- public String getStatus() {
- return status;
- }
-
- public void setStatus(final String status) {
- this.status = status;
- }
-
- @Override
- public String toString() {
- return String.format("order_item_id:%s, order_id: %s, user_id: %s, status: %s", orderItemId, orderId, userId, status);
- }
-}
diff --git a/examples/example-core/example-api/src/main/java/org/apache/shardingsphere/example/core/api/entity/ShadowUser.java b/examples/example-core/example-api/src/main/java/org/apache/shardingsphere/example/core/api/entity/ShadowUser.java
deleted file mode 100644
index c5c334e..0000000
--- a/examples/example-core/example-api/src/main/java/org/apache/shardingsphere/example/core/api/entity/ShadowUser.java
+++ /dev/null
@@ -1,90 +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.core.api.entity;
-
-import java.io.Serializable;
-
-public class ShadowUser implements Serializable {
-
- private static final long serialVersionUID = 263434701950670170L;
-
- private int userId;
-
- private String userName;
-
- private String userNamePlain;
-
- private String pwd;
-
- private String assistedQueryPwd;
-
- private Boolean shadow;
-
- public int getUserId() {
- return userId;
- }
-
- public void setUserId(final int userId) {
- this.userId = userId;
- }
-
- public String getUserName() {
- return userName;
- }
-
- public void setUserName(final String userName) {
- this.userName = userName;
- }
-
- public String getUserNamePlain() {
- return userNamePlain;
- }
-
- public void setUserNamePlain(final String userNamePlain) {
- this.userNamePlain = userNamePlain;
- }
-
- public String getPwd() {
- return pwd;
- }
-
- public void setPwd(final String pwd) {
- this.pwd = pwd;
- }
-
- public String getAssistedQueryPwd() {
- return assistedQueryPwd;
- }
-
- public void setAssistedQueryPwd(final String assistedQueryPwd) {
- this.assistedQueryPwd = assistedQueryPwd;
- }
-
- public Boolean isShadow() {
- return shadow;
- }
-
- public void setShadow(final Boolean shadow) {
- this.shadow = shadow;
- }
-
- @Override
- public String toString() {
- return String.format("user_id: %d, user_name: %s, user_name_plain: %s, pwd: %s, assisted_query_pwd: %s, shadow: %s", userId, userName, userNamePlain, pwd, assistedQueryPwd, shadow);
- }
-}
diff --git a/examples/example-core/example-api/src/main/java/org/apache/shardingsphere/example/core/api/entity/User.java b/examples/example-core/example-api/src/main/java/org/apache/shardingsphere/example/core/api/entity/User.java
deleted file mode 100644
index 20971f2..0000000
--- a/examples/example-core/example-api/src/main/java/org/apache/shardingsphere/example/core/api/entity/User.java
+++ /dev/null
@@ -1,60 +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.core.api.entity;
-
-import java.io.Serializable;
-
-public class User implements Serializable {
-
- private static final long serialVersionUID = 263434701950670170L;
-
- private int userId;
-
- private String userName;
-
- private String pwd;
-
- public int getUserId() {
- return userId;
- }
-
- public void setUserId(final int userId) {
- this.userId = userId;
- }
-
- public String getUserName() {
- return userName;
- }
-
- public void setUserName(final String userName) {
- this.userName = userName;
- }
-
- public String getPwd() {
- return pwd;
- }
-
- public void setPwd(final String pwd) {
- this.pwd = pwd;
- }
-
- @Override
- public String toString() {
- return String.format("user_id: %d, user_name: %s, pwd: %s", userId, userName, pwd);
- }
-}
diff --git a/examples/example-core/example-api/src/main/java/org/apache/shardingsphere/example/core/api/repository/AddressRepository.java b/examples/example-core/example-api/src/main/java/org/apache/shardingsphere/example/core/api/repository/AddressRepository.java
deleted file mode 100644
index 2f7edcc..0000000
--- a/examples/example-core/example-api/src/main/java/org/apache/shardingsphere/example/core/api/repository/AddressRepository.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.core.api.repository;
-
-import org.apache.shardingsphere.example.core.api.entity.Address;
-
-public interface AddressRepository extends CommonRepository<Address, Long> {
-}
diff --git a/examples/example-core/example-api/src/main/java/org/apache/shardingsphere/example/core/api/repository/CommonRepository.java b/examples/example-core/example-api/src/main/java/org/apache/shardingsphere/example/core/api/repository/CommonRepository.java
deleted file mode 100644
index 1bb4bff..0000000
--- a/examples/example-core/example-api/src/main/java/org/apache/shardingsphere/example/core/api/repository/CommonRepository.java
+++ /dev/null
@@ -1,70 +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.core.api.repository;
-
-import java.sql.SQLException;
-import java.util.List;
-
-public interface CommonRepository<T, P> {
-
- /**
- * Create table if not exist.
- *
- * @throws SQLException SQL exception
- */
- void createTableIfNotExists() throws SQLException;
-
- /**
- * Drop table.
- *
- * @throws SQLException SQL exception
- */
- void dropTable() throws SQLException;
-
- /**
- * Truncate table.
- *
- * @throws SQLException SQL exception
- */
- void truncateTable() throws SQLException;
-
- /**
- * insert data.
- *
- * @param entity entity
- * @return generated primary key
- * @throws SQLException SQL exception
- */
- P insert(T entity) throws SQLException;
-
- /**
- * Delete data.
- *
- * @param primaryKey primaryKey
- * @throws SQLException SQL exception
- */
- void delete(P primaryKey) throws SQLException;
-
- /**
- * Select all data.
- *
- * @return all data
- * @throws SQLException SQL exception
- */
- List<T> selectAll() throws SQLException;
-}
diff --git a/examples/example-core/example-api/src/main/java/org/apache/shardingsphere/example/core/api/repository/OrderItemRepository.java b/examples/example-core/example-api/src/main/java/org/apache/shardingsphere/example/core/api/repository/OrderItemRepository.java
deleted file mode 100644
index f84c6ea..0000000
--- a/examples/example-core/example-api/src/main/java/org/apache/shardingsphere/example/core/api/repository/OrderItemRepository.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.core.api.repository;
-
-import org.apache.shardingsphere.example.core.api.entity.OrderItem;
-
-public interface OrderItemRepository extends CommonRepository<OrderItem, Long> {
-}
diff --git a/examples/example-core/example-api/src/main/java/org/apache/shardingsphere/example/core/api/repository/OrderRepository.java b/examples/example-core/example-api/src/main/java/org/apache/shardingsphere/example/core/api/repository/OrderRepository.java
deleted file mode 100644
index 255cf73..0000000
--- a/examples/example-core/example-api/src/main/java/org/apache/shardingsphere/example/core/api/repository/OrderRepository.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.core.api.repository;
-
-import org.apache.shardingsphere.example.core.api.entity.Order;
-
-public interface OrderRepository extends CommonRepository<Order, Long> {
-}
diff --git a/examples/example-core/example-api/src/main/java/org/apache/shardingsphere/example/core/api/repository/ShadowUserRepository.java b/examples/example-core/example-api/src/main/java/org/apache/shardingsphere/example/core/api/repository/ShadowUserRepository.java
deleted file mode 100644
index 926801a..0000000
--- a/examples/example-core/example-api/src/main/java/org/apache/shardingsphere/example/core/api/repository/ShadowUserRepository.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.core.api.repository;
-
-import org.apache.shardingsphere.example.core.api.entity.ShadowUser;
-
-public interface ShadowUserRepository extends CommonRepository<ShadowUser, Long> {
-}
diff --git a/examples/example-core/example-api/src/main/java/org/apache/shardingsphere/example/core/api/repository/UserRepository.java b/examples/example-core/example-api/src/main/java/org/apache/shardingsphere/example/core/api/repository/UserRepository.java
deleted file mode 100644
index dc762f6..0000000
--- a/examples/example-core/example-api/src/main/java/org/apache/shardingsphere/example/core/api/repository/UserRepository.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.core.api.repository;
-
-import org.apache.shardingsphere.example.core.api.entity.User;
-
-public interface UserRepository extends CommonRepository<User, Long> {
-}
diff --git a/examples/example-core/example-api/src/main/java/org/apache/shardingsphere/example/core/api/service/ExampleService.java b/examples/example-core/example-api/src/main/java/org/apache/shardingsphere/example/core/api/service/ExampleService.java
deleted file mode 100644
index b876523..0000000
--- a/examples/example-core/example-api/src/main/java/org/apache/shardingsphere/example/core/api/service/ExampleService.java
+++ /dev/null
@@ -1,58 +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.core.api.service;
-
-import java.sql.SQLException;
-
-public interface ExampleService {
-
- /**
- * Initialize environment.
- *
- * @throws SQLException SQL exception
- */
- void initEnvironment() throws SQLException;
-
- /**
- * Clean environment.
- *
- * @throws SQLException SQL exception
- */
- void cleanEnvironment() throws SQLException;
-
- /**
- * Process success.
- *
- * @throws SQLException SQL exception
- */
- void processSuccess() throws SQLException;
-
- /**
- * Process failure.
- *
- * @throws SQLException SQL exception
- */
- void processFailure() throws SQLException;
-
- /**
- * Print data.
- *
- * @throws SQLException SQL exception
- */
- void printData() throws SQLException;
-}
diff --git a/examples/example-core/example-raw-jdbc/pom.xml b/examples/example-core/example-raw-jdbc/pom.xml
deleted file mode 100644
index 1448337..0000000
--- a/examples/example-core/example-raw-jdbc/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>example-core</artifactId>
- <version>5.0.0-RC1-SNAPSHOT</version>
- </parent>
- <artifactId>example-raw-jdbc</artifactId>
- <name>${project.artifactId}</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.shardingsphere.example</groupId>
- <artifactId>config-utility</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.shardingsphere.example</groupId>
- <artifactId>example-api</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-</project>
diff --git a/examples/example-core/example-raw-jdbc/src/main/java/org/apache/shardingsphere/example/core/jdbc/repository/AddressRepositoryImpl.java b/examples/example-core/example-raw-jdbc/src/main/java/org/apache/shardingsphere/example/core/jdbc/repository/AddressRepositoryImpl.java
deleted file mode 100644
index f35b7c3..0000000
--- a/examples/example-core/example-raw-jdbc/src/main/java/org/apache/shardingsphere/example/core/jdbc/repository/AddressRepositoryImpl.java
+++ /dev/null
@@ -1,110 +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.core.jdbc.repository;
-
-import org.apache.shardingsphere.example.core.api.entity.Address;
-import org.apache.shardingsphere.example.core.api.repository.AddressRepository;
-
-import javax.sql.DataSource;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.LinkedList;
-import java.util.List;
-
-public final class AddressRepositoryImpl implements AddressRepository {
-
- private final DataSource dataSource;
-
- public AddressRepositoryImpl(final DataSource dataSource) {
- this.dataSource = dataSource;
- }
-
- @Override
- public void createTableIfNotExists() throws SQLException {
- String sql = "CREATE TABLE IF NOT EXISTS t_address "
- + "(address_id BIGINT NOT NULL, address_name VARCHAR(100) NOT NULL, PRIMARY KEY (address_id))";
- try (Connection connection = dataSource.getConnection();
- Statement statement = connection.createStatement()) {
- statement.executeUpdate(sql);
- }
- }
-
- @Override
- public void dropTable() throws SQLException {
- String sql = "DROP TABLE t_address";
- try (Connection connection = dataSource.getConnection();
- Statement statement = connection.createStatement()) {
- statement.executeUpdate(sql);
- }
- }
-
- @Override
- public void truncateTable() throws SQLException {
- String sql = "TRUNCATE TABLE t_address";
- try (Connection connection = dataSource.getConnection();
- Statement statement = connection.createStatement()) {
- statement.executeUpdate(sql);
- }
- }
-
- @Override
- public Long insert(final Address entity) throws SQLException {
- String sql = "INSERT INTO t_address (address_id, address_name) VALUES (?, ?)";
- try (Connection connection = dataSource.getConnection();
- PreparedStatement preparedStatement = connection.prepareStatement(sql)) {
- preparedStatement.setLong(1, entity.getAddressId());
- preparedStatement.setString(2, entity.getAddressName());
- preparedStatement.executeUpdate();
- }
- return entity.getAddressId();
- }
-
- @Override
- public void delete(final Long primaryKey) throws SQLException {
- String sql = "DELETE FROM t_address WHERE address_id=?";
- try (Connection connection = dataSource.getConnection();
- PreparedStatement preparedStatement = connection.prepareStatement(sql)) {
- preparedStatement.setLong(1, primaryKey);
- preparedStatement.executeUpdate();
- }
- }
-
- @Override
- public List<Address> selectAll() throws SQLException {
- String sql = "SELECT * FROM t_address";
- return getAddress(sql);
- }
-
- private List<Address> getAddress(final String sql) throws SQLException {
- List<Address> result = new LinkedList<>();
- try (Connection connection = dataSource.getConnection();
- PreparedStatement preparedStatement = connection.prepareStatement(sql);
- ResultSet resultSet = preparedStatement.executeQuery()) {
- while (resultSet.next()) {
- Address address = new Address();
- address.setAddressId(resultSet.getLong(1));
- address.setAddressName(resultSet.getString(2));
- result.add(address);
- }
- }
- return result;
- }
-}
diff --git a/examples/example-core/example-raw-jdbc/src/main/java/org/apache/shardingsphere/example/core/jdbc/repository/OrderItemRepositoryImpl.java b/examples/example-core/example-raw-jdbc/src/main/java/org/apache/shardingsphere/example/core/jdbc/repository/OrderItemRepositoryImpl.java
deleted file mode 100644
index a4c4271..0000000
--- a/examples/example-core/example-raw-jdbc/src/main/java/org/apache/shardingsphere/example/core/jdbc/repository/OrderItemRepositoryImpl.java
+++ /dev/null
@@ -1,120 +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.core.jdbc.repository;
-
-import org.apache.shardingsphere.example.core.api.repository.OrderItemRepository;
-import org.apache.shardingsphere.example.core.api.entity.OrderItem;
-
-import javax.sql.DataSource;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.LinkedList;
-import java.util.List;
-
-public class OrderItemRepositoryImpl implements OrderItemRepository {
-
- private final DataSource dataSource;
-
- public OrderItemRepositoryImpl(final DataSource dataSource) {
- this.dataSource = dataSource;
- }
-
- @Override
- public void createTableIfNotExists() throws SQLException {
- String sql = "CREATE TABLE IF NOT EXISTS t_order_item "
- + "(order_item_id BIGINT NOT NULL AUTO_INCREMENT, order_id BIGINT NOT NULL, user_id INT NOT NULL, status VARCHAR(50), PRIMARY KEY (order_item_id))";
- try (Connection connection = dataSource.getConnection();
- Statement statement = connection.createStatement()) {
- statement.executeUpdate(sql);
- }
- }
-
- @Override
- public void dropTable() throws SQLException {
- String sql = "DROP TABLE t_order_item";
- try (Connection connection = dataSource.getConnection();
- Statement statement = connection.createStatement()) {
- statement.executeUpdate(sql);
- }
- }
-
- @Override
- public void truncateTable() throws SQLException {
- String sql = "TRUNCATE TABLE t_order_item";
- try (Connection connection = dataSource.getConnection();
- Statement statement = connection.createStatement()) {
- statement.executeUpdate(sql);
- }
- }
-
- @Override
- public Long insert(final OrderItem orderItem) throws SQLException {
- String sql = "INSERT INTO t_order_item (order_id, user_id, status) VALUES (?, ?, ?)";
- try (Connection connection = dataSource.getConnection();
- PreparedStatement preparedStatement = connection.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS)) {
- preparedStatement.setLong(1, orderItem.getOrderId());
- preparedStatement.setInt(2, orderItem.getUserId());
- preparedStatement.setString(3, orderItem.getStatus());
- preparedStatement.executeUpdate();
- try (ResultSet resultSet = preparedStatement.getGeneratedKeys()) {
- if (resultSet.next()) {
- orderItem.setOrderItemId(resultSet.getLong(1));
- }
- }
- }
- return orderItem.getOrderItemId();
- }
-
- @Override
- public void delete(final Long orderItemId) throws SQLException {
- String sql = "DELETE FROM t_order_item WHERE order_id=?";
- try (Connection connection = dataSource.getConnection();
- PreparedStatement preparedStatement = connection.prepareStatement(sql)) {
- preparedStatement.setLong(1, orderItemId);
- preparedStatement.executeUpdate();
- }
- }
-
- @Override
- public List<OrderItem> selectAll() throws SQLException {
- // TODO Associated query with encrypt may query and decrypt failed. see https://github.com/apache/shardingsphere/issues/3352
-// String sql = "SELECT i.* FROM t_order o, t_order_item i WHERE o.order_id = i.order_id";
- String sql = "SELECT * FROM t_order_item";
- return getOrderItems(sql);
- }
-
- protected List<OrderItem> getOrderItems(final String sql) throws SQLException {
- List<OrderItem> result = new LinkedList<>();
- try (Connection connection = dataSource.getConnection();
- PreparedStatement preparedStatement = connection.prepareStatement(sql);
- ResultSet resultSet = preparedStatement.executeQuery()) {
- while (resultSet.next()) {
- OrderItem orderItem = new OrderItem();
- orderItem.setOrderItemId(resultSet.getLong(1));
- orderItem.setOrderId(resultSet.getLong(2));
- orderItem.setUserId(resultSet.getInt(3));
- orderItem.setStatus(resultSet.getString(4));
- result.add(orderItem);
- }
- }
- return result;
- }
-}
diff --git a/examples/example-core/example-raw-jdbc/src/main/java/org/apache/shardingsphere/example/core/jdbc/repository/OrderRepositoryImpl.java b/examples/example-core/example-raw-jdbc/src/main/java/org/apache/shardingsphere/example/core/jdbc/repository/OrderRepositoryImpl.java
deleted file mode 100644
index aa4ea52..0000000
--- a/examples/example-core/example-raw-jdbc/src/main/java/org/apache/shardingsphere/example/core/jdbc/repository/OrderRepositoryImpl.java
+++ /dev/null
@@ -1,117 +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.core.jdbc.repository;
-
-import org.apache.shardingsphere.example.core.api.entity.Order;
-import org.apache.shardingsphere.example.core.api.repository.OrderRepository;
-
-import javax.sql.DataSource;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.LinkedList;
-import java.util.List;
-
-public class OrderRepositoryImpl implements OrderRepository {
-
- private final DataSource dataSource;
-
- public OrderRepositoryImpl(final DataSource dataSource) {
- this.dataSource = dataSource;
- }
-
- @Override
- public void createTableIfNotExists() throws SQLException {
- String sql = "CREATE TABLE IF NOT EXISTS t_order (order_id BIGINT NOT NULL AUTO_INCREMENT, user_id INT NOT NULL, address_id BIGINT NOT NULL, status VARCHAR(50), PRIMARY KEY (order_id))";
- try (Connection connection = dataSource.getConnection();
- Statement statement = connection.createStatement()) {
- statement.executeUpdate(sql);
- }
- }
-
- @Override
- public void dropTable() throws SQLException {
- String sql = "DROP TABLE t_order";
- try (Connection connection = dataSource.getConnection();
- Statement statement = connection.createStatement()) {
- statement.executeUpdate(sql);
- }
- }
-
- @Override
- public void truncateTable() throws SQLException {
- String sql = "TRUNCATE TABLE t_order";
- try (Connection connection = dataSource.getConnection();
- Statement statement = connection.createStatement()) {
- statement.executeUpdate(sql);
- }
- }
-
- @Override
- public Long insert(final Order order) throws SQLException {
- String sql = "INSERT INTO t_order (user_id, address_id, status) VALUES (?, ?, ?)";
- try (Connection connection = dataSource.getConnection();
- PreparedStatement preparedStatement = connection.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS)) {
- preparedStatement.setInt(1, order.getUserId());
- preparedStatement.setLong(2, order.getAddressId());
- preparedStatement.setString(3, order.getStatus());
- preparedStatement.executeUpdate();
- try (ResultSet resultSet = preparedStatement.getGeneratedKeys()) {
- if (resultSet.next()) {
- order.setOrderId(resultSet.getLong(1));
- }
- }
- }
- return order.getOrderId();
- }
-
- @Override
- public void delete(final Long orderId) throws SQLException {
- String sql = "DELETE FROM t_order WHERE order_id=?";
- try (Connection connection = dataSource.getConnection();
- PreparedStatement preparedStatement = connection.prepareStatement(sql)) {
- preparedStatement.setLong(1, orderId);
- preparedStatement.executeUpdate();
- }
- }
-
- @Override
- public List<Order> selectAll() throws SQLException {
- String sql = "SELECT * FROM t_order";
- return getOrders(sql);
- }
-
- protected List<Order> getOrders(final String sql) throws SQLException {
- List<Order> result = new LinkedList<>();
- try (Connection connection = dataSource.getConnection();
- PreparedStatement preparedStatement = connection.prepareStatement(sql);
- ResultSet resultSet = preparedStatement.executeQuery()) {
- while (resultSet.next()) {
- Order order = new Order();
- order.setOrderId(resultSet.getLong(1));
- order.setUserId(resultSet.getInt(2));
- order.setAddressId(resultSet.getLong(3));
- order.setStatus(resultSet.getString(4));
- result.add(order);
- }
- }
- return result;
- }
-}
diff --git a/examples/example-core/example-raw-jdbc/src/main/java/org/apache/shardingsphere/example/core/jdbc/repository/RangeOrderItemRepositoryImpl.java b/examples/example-core/example-raw-jdbc/src/main/java/org/apache/shardingsphere/example/core/jdbc/repository/RangeOrderItemRepositoryImpl.java
deleted file mode 100644
index f5c6916..0000000
--- a/examples/example-core/example-raw-jdbc/src/main/java/org/apache/shardingsphere/example/core/jdbc/repository/RangeOrderItemRepositoryImpl.java
+++ /dev/null
@@ -1,37 +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.core.jdbc.repository;
-
-import org.apache.shardingsphere.example.core.api.entity.OrderItem;
-
-import javax.sql.DataSource;
-import java.sql.SQLException;
-import java.util.List;
-
-public final class RangeOrderItemRepositoryImpl extends OrderItemRepositoryImpl {
-
- public RangeOrderItemRepositoryImpl(final DataSource dataSource) {
- super(dataSource);
- }
-
- @Override
- public List<OrderItem> selectAll() throws SQLException {
- String sql = "SELECT i.* FROM t_order o, t_order_item i WHERE o.order_id = i.order_id AND o.user_id BETWEEN 1 AND 5";
- return getOrderItems(sql);
- }
-}
diff --git a/examples/example-core/example-raw-jdbc/src/main/java/org/apache/shardingsphere/example/core/jdbc/repository/RangeOrderRepositoryImpl.java b/examples/example-core/example-raw-jdbc/src/main/java/org/apache/shardingsphere/example/core/jdbc/repository/RangeOrderRepositoryImpl.java
deleted file mode 100644
index 4dd0e48..0000000
--- a/examples/example-core/example-raw-jdbc/src/main/java/org/apache/shardingsphere/example/core/jdbc/repository/RangeOrderRepositoryImpl.java
+++ /dev/null
@@ -1,37 +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.core.jdbc.repository;
-
-import org.apache.shardingsphere.example.core.api.entity.Order;
-
-import javax.sql.DataSource;
-import java.sql.SQLException;
-import java.util.List;
-
-public final class RangeOrderRepositoryImpl extends OrderRepositoryImpl {
-
- public RangeOrderRepositoryImpl(final DataSource dataSource) {
- super(dataSource);
- }
-
- @Override
- public List<Order> selectAll() throws SQLException {
- String sql = "SELECT * FROM t_order WHERE order_id BETWEEN 200000000000000000 AND 400000000000000000";
- return getOrders(sql);
- }
-}
diff --git a/examples/example-core/example-raw-jdbc/src/main/java/org/apache/shardingsphere/example/core/jdbc/repository/ShadowUserRepositoryImpl.java b/examples/example-core/example-raw-jdbc/src/main/java/org/apache/shardingsphere/example/core/jdbc/repository/ShadowUserRepositoryImpl.java
deleted file mode 100644
index 11ba1a0..0000000
--- a/examples/example-core/example-raw-jdbc/src/main/java/org/apache/shardingsphere/example/core/jdbc/repository/ShadowUserRepositoryImpl.java
+++ /dev/null
@@ -1,123 +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.core.jdbc.repository;
-
-import org.apache.shardingsphere.example.core.api.entity.ShadowUser;
-import org.apache.shardingsphere.example.core.api.repository.ShadowUserRepository;
-
-import javax.sql.DataSource;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.LinkedList;
-import java.util.List;
-
-public final class ShadowUserRepositoryImpl implements ShadowUserRepository {
-
- private final DataSource dataSource;
-
- public ShadowUserRepositoryImpl(final DataSource dataSource) {
- this.dataSource = dataSource;
- }
-
- @Override
- public void createTableIfNotExists() throws SQLException {
- String sql = "CREATE TABLE IF NOT EXISTS t_user "
- + "(user_id INT NOT NULL AUTO_INCREMENT, user_name VARCHAR(200), pwd VARCHAR(200), PRIMARY KEY (user_id))";
- try (Connection connection = dataSource.getConnection();
- Statement statement = connection.createStatement()) {
- statement.executeUpdate(sql);
- }
- }
-
- @Override
- public void dropTable() throws SQLException {
- String sql = "DROP TABLE t_user";
- try (Connection connection = dataSource.getConnection();
- Statement statement = connection.createStatement()) {
- statement.executeUpdate(sql);
- }
- }
-
- @Override
- public void truncateTable() throws SQLException {
- String sql = "TRUNCATE TABLE t_user";
- try (Connection connection = dataSource.getConnection();
- Statement statement = connection.createStatement()) {
- statement.executeUpdate(sql);
- }
- }
-
- @Override
- public Long insert(final ShadowUser entity) throws SQLException {
- String sql = "INSERT INTO t_user (user_id, user_name, pwd,shadow) VALUES (?, ?, ?,?)";
- try (Connection connection = dataSource.getConnection();
- PreparedStatement preparedStatement = connection.prepareStatement(sql)) {
- preparedStatement.setInt(1, entity.getUserId());
- preparedStatement.setString(2, entity.getUserName());
- preparedStatement.setString(3, entity.getPwd());
- preparedStatement.setBoolean(4, entity.isShadow());
- preparedStatement.executeUpdate();
- }
- return (long) entity.getUserId();
- }
-
- @Override
- public void delete(final Long id) throws SQLException {
- String sql = "DELETE FROM t_user WHERE user_id=? and shadow=?";
- deleteUser(sql, id, true);
- deleteUser(sql, id, false);
- }
-
- private void deleteUser(final String sql, final Long id, final boolean isShadow) throws SQLException {
- try (Connection connection = dataSource.getConnection();
- PreparedStatement preparedStatement = connection.prepareStatement(sql)) {
- preparedStatement.setLong(1, id);
- preparedStatement.setBoolean(2, isShadow);
- preparedStatement.executeUpdate();
- }
- }
-
- @Override
- public List<ShadowUser> selectAll() throws SQLException {
- List<ShadowUser> users;
- String sql = "SELECT * FROM t_user where shadow=?";
- users = getUsers(sql, false);
- users.addAll(getUsers(sql, true));
- return users;
- }
-
- private List<ShadowUser> getUsers(final String sql, final boolean isShadow) throws SQLException {
- List<ShadowUser> result = new LinkedList<>();
- try (Connection connection = dataSource.getConnection();
- PreparedStatement preparedStatement = connection.prepareStatement(sql)) {
- preparedStatement.setBoolean(1, isShadow);
- ResultSet resultSet = preparedStatement.executeQuery();
- while (resultSet.next()) {
- ShadowUser user = new ShadowUser();
- user.setUserId(resultSet.getInt("user_id"));
- user.setUserName(resultSet.getString("user_name"));
- user.setPwd(resultSet.getString("pwd"));
- result.add(user);
- }
- }
- return result;
- }
-}
diff --git a/examples/example-core/example-raw-jdbc/src/main/java/org/apache/shardingsphere/example/core/jdbc/repository/UserRepositoryImpl.java b/examples/example-core/example-raw-jdbc/src/main/java/org/apache/shardingsphere/example/core/jdbc/repository/UserRepositoryImpl.java
deleted file mode 100644
index 4af2852..0000000
--- a/examples/example-core/example-raw-jdbc/src/main/java/org/apache/shardingsphere/example/core/jdbc/repository/UserRepositoryImpl.java
+++ /dev/null
@@ -1,112 +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.core.jdbc.repository;
-
-import org.apache.shardingsphere.example.core.api.entity.User;
-import org.apache.shardingsphere.example.core.api.repository.UserRepository;
-
-import javax.sql.DataSource;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.LinkedList;
-import java.util.List;
-
-public final class UserRepositoryImpl implements UserRepository {
-
- private final DataSource dataSource;
-
- public UserRepositoryImpl(final DataSource dataSource) {
- this.dataSource = dataSource;
- }
-
- @Override
- public void createTableIfNotExists() throws SQLException {
- String sql = "CREATE TABLE IF NOT EXISTS t_user "
- + "(user_id INT NOT NULL AUTO_INCREMENT, user_name VARCHAR(200), pwd VARCHAR(200), PRIMARY KEY (user_id))";
- try (Connection connection = dataSource.getConnection();
- Statement statement = connection.createStatement()) {
- statement.executeUpdate(sql);
- }
- }
-
- @Override
- public void dropTable() throws SQLException {
- String sql = "DROP TABLE t_user";
- try (Connection connection = dataSource.getConnection();
- Statement statement = connection.createStatement()) {
- statement.executeUpdate(sql);
- }
- }
-
- @Override
- public void truncateTable() throws SQLException {
- String sql = "TRUNCATE TABLE t_user";
- try (Connection connection = dataSource.getConnection();
- Statement statement = connection.createStatement()) {
- statement.executeUpdate(sql);
- }
- }
-
- @Override
- public Long insert(final User entity) throws SQLException {
- String sql = "INSERT INTO t_user (user_id, user_name, pwd) VALUES (?, ?, ?)";
- try (Connection connection = dataSource.getConnection();
- PreparedStatement preparedStatement = connection.prepareStatement(sql)) {
- preparedStatement.setInt(1, entity.getUserId());
- preparedStatement.setString(2, entity.getUserName());
- preparedStatement.setString(3, entity.getPwd());
- preparedStatement.executeUpdate();
- }
- return (long) entity.getUserId();
- }
-
- @Override
- public void delete(final Long id) throws SQLException {
- String sql = "DELETE FROM t_user WHERE user_id=?";
- try (Connection connection = dataSource.getConnection();
- PreparedStatement preparedStatement = connection.prepareStatement(sql)) {
- preparedStatement.setLong(1, id);
- preparedStatement.executeUpdate();
- }
- }
-
- @Override
- public List<User> selectAll() throws SQLException {
- String sql = "SELECT * FROM t_user";
- return getUsers(sql);
- }
-
- private List<User> getUsers(final String sql) throws SQLException {
- List<User> result = new LinkedList<>();
- try (Connection connection = dataSource.getConnection();
- PreparedStatement preparedStatement = connection.prepareStatement(sql);
- ResultSet resultSet = preparedStatement.executeQuery()) {
- while (resultSet.next()) {
- User user = new User();
- user.setUserId(resultSet.getInt("user_id"));
- user.setUserName(resultSet.getString("user_name"));
- user.setPwd(resultSet.getString("pwd"));
- result.add(user);
- }
- }
- return result;
- }
-}
diff --git a/examples/example-core/example-raw-jdbc/src/main/java/org/apache/shardingsphere/example/core/jdbc/service/OrderServiceImpl.java b/examples/example-core/example-raw-jdbc/src/main/java/org/apache/shardingsphere/example/core/jdbc/service/OrderServiceImpl.java
deleted file mode 100644
index 928b09d..0000000
--- a/examples/example-core/example-raw-jdbc/src/main/java/org/apache/shardingsphere/example/core/jdbc/service/OrderServiceImpl.java
+++ /dev/null
@@ -1,156 +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.core.jdbc.service;
-
-import org.apache.shardingsphere.example.core.api.entity.Address;
-import org.apache.shardingsphere.example.core.api.entity.Order;
-import org.apache.shardingsphere.example.core.api.entity.OrderItem;
-import org.apache.shardingsphere.example.core.api.repository.AddressRepository;
-import org.apache.shardingsphere.example.core.api.repository.OrderItemRepository;
-import org.apache.shardingsphere.example.core.api.repository.OrderRepository;
-import org.apache.shardingsphere.example.core.api.service.ExampleService;
-import org.apache.shardingsphere.example.core.jdbc.repository.AddressRepositoryImpl;
-import org.apache.shardingsphere.example.core.jdbc.repository.OrderItemRepositoryImpl;
-import org.apache.shardingsphere.example.core.jdbc.repository.OrderRepositoryImpl;
-
-import javax.sql.DataSource;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.List;
-
-public final class OrderServiceImpl implements ExampleService {
-
- private final OrderRepository orderRepository;
-
- private final OrderItemRepository orderItemRepository;
-
- private final AddressRepository addressRepository;
-
- public OrderServiceImpl(final DataSource dataSource) {
- orderRepository = new OrderRepositoryImpl(dataSource);
- orderItemRepository = new OrderItemRepositoryImpl(dataSource);
- addressRepository = new AddressRepositoryImpl(dataSource);
- }
-
- public OrderServiceImpl(final OrderRepository orderRepository, final OrderItemRepository orderItemRepository, final AddressRepository addressRepository) {
- this.orderRepository = orderRepository;
- this.orderItemRepository = orderItemRepository;
- this.addressRepository = addressRepository;
- }
-
- @Override
- public void initEnvironment() throws SQLException {
- orderRepository.createTableIfNotExists();
- orderItemRepository.createTableIfNotExists();
- orderRepository.truncateTable();
- orderItemRepository.truncateTable();
- initAddressTable();
- }
-
- private void initAddressTable() throws SQLException {
- addressRepository.createTableIfNotExists();
- addressRepository.truncateTable();
- initAddressData();
- }
-
- private void initAddressData() throws SQLException {
- for (int i = 0; i < 10; i++) {
- insertAddress(i);
- }
- }
-
- private void insertAddress(final int i) throws SQLException {
- Address address = new Address();
- address.setAddressId((long) i);
- address.setAddressName("address_" + i);
- addressRepository.insert(address);
- }
-
- @Override
- public void cleanEnvironment() throws SQLException {
- orderRepository.dropTable();
- orderItemRepository.dropTable();
- addressRepository.dropTable();
- }
-
- @Override
- public void processSuccess() throws SQLException {
- System.out.println("-------------- Process Success Begin ---------------");
- List<Long> orderIds = insertData();
- printData();
- deleteData(orderIds);
- printData();
- System.out.println("-------------- Process Success Finish --------------");
- }
-
- @Override
- public void processFailure() throws SQLException {
- System.out.println("-------------- Process Failure Begin ---------------");
- insertData();
- System.out.println("-------------- Process Failure Finish --------------");
- throw new RuntimeException("Exception occur for transaction test.");
- }
-
- private List<Long> insertData() throws SQLException {
- System.out.println("---------------------------- Insert Data ----------------------------");
- List<Long> result = new ArrayList<>(10);
- for (int i = 1; i <= 10; i++) {
- Order order = insertOrder(i);
- insertOrderItem(i, order);
- result.add(order.getOrderId());
- }
- return result;
- }
-
- private Order insertOrder(final int i) throws SQLException {
- Order order = new Order();
- order.setUserId(i);
- order.setAddressId(i);
- order.setStatus("INSERT_TEST");
- orderRepository.insert(order);
- return order;
- }
-
- private void insertOrderItem(final int i, final Order order) throws SQLException {
- OrderItem item = new OrderItem();
- item.setOrderId(order.getOrderId());
- item.setUserId(i);
- item.setStatus("INSERT_TEST");
- orderItemRepository.insert(item);
- }
-
- private void deleteData(final List<Long> orderIds) throws SQLException {
- System.out.println("---------------------------- Delete Data ----------------------------");
- for (Long each : orderIds) {
- orderRepository.delete(each);
- orderItemRepository.delete(each);
- }
- }
-
- @Override
- public void printData() throws SQLException {
- System.out.println("---------------------------- Print Order Data -----------------------");
- for (Object each : orderRepository.selectAll()) {
- System.out.println(each);
- }
- System.out.println("---------------------------- Print OrderItem Data -------------------");
- for (Object each : orderItemRepository.selectAll()) {
- System.out.println(each);
- }
- }
-}
diff --git a/examples/example-core/example-raw-jdbc/src/main/java/org/apache/shardingsphere/example/core/jdbc/service/ShadowUserServiceImpl.java b/examples/example-core/example-raw-jdbc/src/main/java/org/apache/shardingsphere/example/core/jdbc/service/ShadowUserServiceImpl.java
deleted file mode 100644
index d733db8..0000000
--- a/examples/example-core/example-raw-jdbc/src/main/java/org/apache/shardingsphere/example/core/jdbc/service/ShadowUserServiceImpl.java
+++ /dev/null
@@ -1,94 +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.core.jdbc.service;
-
-import org.apache.shardingsphere.example.core.api.entity.ShadowUser;
-import org.apache.shardingsphere.example.core.api.repository.ShadowUserRepository;
-import org.apache.shardingsphere.example.core.api.service.ExampleService;
-
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.List;
-
-public final class ShadowUserServiceImpl implements ExampleService {
-
- private final ShadowUserRepository userRepository;
-
- public ShadowUserServiceImpl(final ShadowUserRepository userRepository) {
- this.userRepository = userRepository;
- }
-
- @Override
- public void initEnvironment() throws SQLException {
- userRepository.createTableIfNotExists();
- userRepository.truncateTable();
- }
-
- @Override
- public void cleanEnvironment() throws SQLException {
- userRepository.dropTable();
- }
-
- @Override
- public void processSuccess() throws SQLException {
- System.out.println("-------------- Process Success Begin ---------------");
- List<Long> userIds = insertData();
- printData();
- deleteData(userIds);
- printData();
- System.out.println("-------------- Process Success Finish --------------");
- }
-
- @Override
- public void processFailure() throws SQLException {
- System.out.println("-------------- Process Failure Begin ---------------");
- insertData();
- System.out.println("-------------- Process Failure Finish --------------");
- throw new RuntimeException("Exception occur for transaction test.");
- }
-
- private List<Long> insertData() throws SQLException {
- System.out.println("---------------------------- Insert Data ----------------------------");
- List<Long> result = new ArrayList<>(10);
- for (int i = 1; i <= 10; i++) {
- ShadowUser user = new ShadowUser();
- user.setUserId(i);
- user.setUserName("test_" + i);
- user.setPwd("pwd" + i);
- user.setShadow(i % 2 == 0);
- userRepository.insert(user);
- result.add((long) user.getUserId());
- }
- return result;
- }
-
- private void deleteData(final List<Long> userIds) throws SQLException {
- System.out.println("---------------------------- Delete Data ----------------------------");
- for (Long each : userIds) {
- userRepository.delete(each);
- }
- }
-
- @Override
- public void printData() throws SQLException {
- System.out.println("---------------------------- Print User Data -----------------------");
- for (Object each : userRepository.selectAll()) {
- System.out.println(each);
- }
- }
-}
diff --git a/examples/example-core/example-raw-jdbc/src/main/java/org/apache/shardingsphere/example/core/jdbc/service/UserServiceImpl.java b/examples/example-core/example-raw-jdbc/src/main/java/org/apache/shardingsphere/example/core/jdbc/service/UserServiceImpl.java
deleted file mode 100644
index c62157b..0000000
--- a/examples/example-core/example-raw-jdbc/src/main/java/org/apache/shardingsphere/example/core/jdbc/service/UserServiceImpl.java
+++ /dev/null
@@ -1,93 +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.core.jdbc.service;
-
-import org.apache.shardingsphere.example.core.api.service.ExampleService;
-import org.apache.shardingsphere.example.core.api.entity.User;
-import org.apache.shardingsphere.example.core.api.repository.UserRepository;
-
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.List;
-
-public final class UserServiceImpl implements ExampleService {
-
- private final UserRepository userRepository;
-
- public UserServiceImpl(final UserRepository userRepository) {
- this.userRepository = userRepository;
- }
-
- @Override
- public void initEnvironment() throws SQLException {
- userRepository.createTableIfNotExists();
- userRepository.truncateTable();
- }
-
- @Override
- public void cleanEnvironment() throws SQLException {
- userRepository.dropTable();
- }
-
- @Override
- public void processSuccess() throws SQLException {
- System.out.println("-------------- Process Success Begin ---------------");
- List<Long> userIds = insertData();
- printData();
- deleteData(userIds);
- printData();
- System.out.println("-------------- Process Success Finish --------------");
- }
-
- @Override
- public void processFailure() throws SQLException {
- System.out.println("-------------- Process Failure Begin ---------------");
- insertData();
- System.out.println("-------------- Process Failure Finish --------------");
- throw new RuntimeException("Exception occur for transaction test.");
- }
-
- private List<Long> insertData() throws SQLException {
- System.out.println("---------------------------- Insert Data ----------------------------");
- List<Long> result = new ArrayList<>(10);
- for (int i = 1; i <= 10; i++) {
- User user = new User();
- user.setUserId(i);
- user.setUserName("test_" + i);
- user.setPwd("pwd" + i);
- userRepository.insert(user);
- result.add((long) user.getUserId());
- }
- return result;
- }
-
- private void deleteData(final List<Long> userIds) throws SQLException {
- System.out.println("---------------------------- Delete Data ----------------------------");
- for (Long each : userIds) {
- userRepository.delete(each);
- }
- }
-
- @Override
- public void printData() throws SQLException {
- System.out.println("---------------------------- Print User Data -----------------------");
- for (Object each : userRepository.selectAll()) {
- System.out.println(each);
- }
- }
-}
diff --git a/examples/example-core/example-spring-jpa/pom.xml b/examples/example-core/example-spring-jpa/pom.xml
deleted file mode 100644
index 8682aad..0000000
--- a/examples/example-core/example-spring-jpa/pom.xml
+++ /dev/null
@@ -1,64 +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>example-core</artifactId>
- <version>5.0.0-RC1-SNAPSHOT</version>
- </parent>
- <artifactId>example-spring-jpa</artifactId>
- <name>${project.artifactId}</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.shardingsphere.example</groupId>
- <artifactId>config-utility</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.shardingsphere.example</groupId>
- <artifactId>example-api</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.hibernate.javax.persistence</groupId>
- <artifactId>hibernate-jpa-2.1-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-entitymanager</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-orm</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context-support</artifactId>
- </dependency>
- </dependencies>
-</project>
diff --git a/examples/example-core/example-spring-jpa/src/main/java/org/apache/shardingsphere/example/core/jpa/entity/AddressEntity.java b/examples/example-core/example-spring-jpa/src/main/java/org/apache/shardingsphere/example/core/jpa/entity/AddressEntity.java
deleted file mode 100644
index c84e06a..0000000
--- a/examples/example-core/example-spring-jpa/src/main/java/org/apache/shardingsphere/example/core/jpa/entity/AddressEntity.java
+++ /dev/null
@@ -1,45 +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.core.jpa.entity;
-
-import org.apache.shardingsphere.example.core.api.entity.Address;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-@Entity
-@Table(name = "t_address")
-public final class AddressEntity extends Address {
-
- private static final long serialVersionUID = 4743102234543827855L;
-
- @Id
- @Column(name = "address_id")
- @Override
- public Long getAddressId() {
- return super.getAddressId();
- }
-
- @Column(name = "address_name")
- @Override
- public String getAddressName() {
- return super.getAddressName();
- }
-}
diff --git a/examples/example-core/example-spring-jpa/src/main/java/org/apache/shardingsphere/example/core/jpa/entity/OrderEntity.java b/examples/example-core/example-spring-jpa/src/main/java/org/apache/shardingsphere/example/core/jpa/entity/OrderEntity.java
deleted file mode 100644
index c0c050c..0000000
--- a/examples/example-core/example-spring-jpa/src/main/java/org/apache/shardingsphere/example/core/jpa/entity/OrderEntity.java
+++ /dev/null
@@ -1,60 +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.core.jpa.entity;
-
-import org.apache.shardingsphere.example.core.api.entity.Order;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-@Entity
-@Table(name = "t_order")
-public final class OrderEntity extends Order {
-
- private static final long serialVersionUID = 4743102234543827854L;
-
- @Id
- @Column(name = "order_id")
- @GeneratedValue(strategy = GenerationType.IDENTITY)
- @Override
- public long getOrderId() {
- return super.getOrderId();
- }
-
- @Column(name = "user_id")
- @Override
- public int getUserId() {
- return super.getUserId();
- }
-
- @Column(name = "address_id")
- @Override
- public long getAddressId() {
- return super.getAddressId();
- }
-
- @Column(name = "status")
- @Override
- public String getStatus() {
- return super.getStatus();
- }
-}
diff --git a/examples/example-core/example-spring-jpa/src/main/java/org/apache/shardingsphere/example/core/jpa/entity/OrderItemEntity.java b/examples/example-core/example-spring-jpa/src/main/java/org/apache/shardingsphere/example/core/jpa/entity/OrderItemEntity.java
deleted file mode 100644
index a2125e2..0000000
--- a/examples/example-core/example-spring-jpa/src/main/java/org/apache/shardingsphere/example/core/jpa/entity/OrderItemEntity.java
+++ /dev/null
@@ -1,60 +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.core.jpa.entity;
-
-import org.apache.shardingsphere.example.core.api.entity.OrderItem;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-@Entity
-@Table(name = "t_order_item")
-public final class OrderItemEntity extends OrderItem {
-
- private static final long serialVersionUID = 5685474394188443341L;
-
- @Id
- @Column(name = "order_item_id")
- @GeneratedValue(strategy = GenerationType.IDENTITY)
- @Override
- public long getOrderItemId() {
- return super.getOrderItemId();
- }
-
- @Column(name = "order_id")
- @Override
- public long getOrderId() {
- return super.getOrderId();
- }
-
- @Column(name = "user_id")
- @Override
- public int getUserId() {
- return super.getUserId();
- }
-
- @Column(name = "status")
- @Override
- public String getStatus() {
- return super.getStatus();
- }
-}
diff --git a/examples/example-core/example-spring-jpa/src/main/java/org/apache/shardingsphere/example/core/jpa/entity/ShadowUserEntity.java b/examples/example-core/example-spring-jpa/src/main/java/org/apache/shardingsphere/example/core/jpa/entity/ShadowUserEntity.java
deleted file mode 100644
index d6577b4..0000000
--- a/examples/example-core/example-spring-jpa/src/main/java/org/apache/shardingsphere/example/core/jpa/entity/ShadowUserEntity.java
+++ /dev/null
@@ -1,57 +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.core.jpa.entity;
-
-import org.apache.shardingsphere.example.core.api.entity.ShadowUser;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-@Entity
-@Table(name = "t_shadow_user")
-public final class ShadowUserEntity extends ShadowUser {
-
- private static final long serialVersionUID = -3708998745561667721L;
-
- @Id
- @Column(name = "user_id")
- @Override
- public int getUserId() {
- return super.getUserId();
- }
-
- @Column(name = "user_name")
- @Override
- public String getUserName() {
- return super.getUserName();
- }
-
- @Column(name = "pwd")
- @Override
- public String getPwd() {
- return super.getPwd();
- }
-
- @Column(name = "shadow")
- @Override
- public Boolean isShadow() {
- return super.isShadow();
- }
-}
diff --git a/examples/example-core/example-spring-jpa/src/main/java/org/apache/shardingsphere/example/core/jpa/entity/UserEntity.java b/examples/example-core/example-spring-jpa/src/main/java/org/apache/shardingsphere/example/core/jpa/entity/UserEntity.java
deleted file mode 100644
index cba86fa..0000000
--- a/examples/example-core/example-spring-jpa/src/main/java/org/apache/shardingsphere/example/core/jpa/entity/UserEntity.java
+++ /dev/null
@@ -1,52 +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.core.jpa.entity;
-
-import org.apache.shardingsphere.example.core.api.entity.User;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-@Entity
-@Table(name = "t_user")
-public final class UserEntity extends User {
-
- private static final long serialVersionUID = -3708998745561667721L;
-
- @Id
- @Column(name = "user_id")
- @Override
- public int getUserId() {
- return super.getUserId();
- }
-
- @Column(name = "user_name")
- @Override
- public String getUserName() {
- return super.getUserName();
- }
-
- @Column(name = "pwd")
- @Override
- public String getPwd() {
- return super.getPwd();
- }
-
-}
diff --git a/examples/example-core/example-spring-jpa/src/main/java/org/apache/shardingsphere/example/core/jpa/repository/AddressRepositoryImpl.java b/examples/example-core/example-spring-jpa/src/main/java/org/apache/shardingsphere/example/core/jpa/repository/AddressRepositoryImpl.java
deleted file mode 100644
index dbaa7b7..0000000
--- a/examples/example-core/example-spring-jpa/src/main/java/org/apache/shardingsphere/example/core/jpa/repository/AddressRepositoryImpl.java
+++ /dev/null
@@ -1,70 +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.core.jpa.repository;
-
-import org.apache.shardingsphere.example.core.api.entity.Address;
-import org.apache.shardingsphere.example.core.api.repository.AddressRepository;
-import org.springframework.stereotype.Repository;
-
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.persistence.Query;
-import javax.transaction.Transactional;
-import java.util.List;
-
-@Repository
-@Transactional
-public class AddressRepositoryImpl implements AddressRepository {
-
- @PersistenceContext
- private EntityManager entityManager;
-
- @Override
- public void createTableIfNotExists() {
- throw new UnsupportedOperationException("createTableIfNotExists for JPA");
- }
-
- @Override
- public void dropTable() {
- throw new UnsupportedOperationException("dropTable for JPA");
- }
-
- @Override
- public void truncateTable() {
- throw new UnsupportedOperationException("truncateTable for JPA");
- }
-
- @Override
- public Long insert(final Address entity) {
- entityManager.persist(entity);
- return entity.getAddressId();
- }
-
- @Override
- public void delete(final Long addressCode) {
- Query query = entityManager.createQuery("DELETE FROM AddressEntity i WHERE i.addressId = ?1");
- query.setParameter(1, addressCode);
- query.executeUpdate();
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public List<Address> selectAll() {
- return (List<Address>) entityManager.createQuery("SELECT i FROM AddressEntity i").getResultList();
- }
-}
diff --git a/examples/example-core/example-spring-jpa/src/main/java/org/apache/shardingsphere/example/core/jpa/repository/OrderItemRepositoryImpl.java b/examples/example-core/example-spring-jpa/src/main/java/org/apache/shardingsphere/example/core/jpa/repository/OrderItemRepositoryImpl.java
deleted file mode 100644
index e091d7e..0000000
--- a/examples/example-core/example-spring-jpa/src/main/java/org/apache/shardingsphere/example/core/jpa/repository/OrderItemRepositoryImpl.java
+++ /dev/null
@@ -1,70 +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.core.jpa.repository;
-
-import org.apache.shardingsphere.example.core.api.repository.OrderItemRepository;
-import org.apache.shardingsphere.example.core.api.entity.OrderItem;
-import org.springframework.stereotype.Repository;
-
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.persistence.Query;
-import javax.transaction.Transactional;
-import java.util.List;
-
-@Repository
-@Transactional
-public class OrderItemRepositoryImpl implements OrderItemRepository {
-
- @PersistenceContext
- private EntityManager entityManager;
-
- @Override
- public void createTableIfNotExists() {
- throw new UnsupportedOperationException("createTableIfNotExists for JPA");
- }
-
- @Override
- public void truncateTable() {
- throw new UnsupportedOperationException("truncateTable for JPA");
- }
-
- @Override
- public void dropTable() {
- throw new UnsupportedOperationException("dropTable for JPA");
- }
-
- @Override
- public Long insert(final OrderItem orderItem) {
- entityManager.persist(orderItem);
- return orderItem.getOrderItemId();
- }
-
- @Override
- public void delete(final Long orderItemId) {
- Query query = entityManager.createQuery("DELETE FROM OrderItemEntity i WHERE i.orderItemId = ?1 AND i.userId = 51");
- query.setParameter(1, orderItemId);
- query.executeUpdate();
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public List<OrderItem> selectAll() {
- return (List<OrderItem>) entityManager.createQuery("SELECT o from OrderItemEntity o").getResultList();
- }
-}
diff --git a/examples/example-core/example-spring-jpa/src/main/java/org/apache/shardingsphere/example/core/jpa/repository/OrderRepositoryImpl.java b/examples/example-core/example-spring-jpa/src/main/java/org/apache/shardingsphere/example/core/jpa/repository/OrderRepositoryImpl.java
deleted file mode 100644
index 5621c3f..0000000
--- a/examples/example-core/example-spring-jpa/src/main/java/org/apache/shardingsphere/example/core/jpa/repository/OrderRepositoryImpl.java
+++ /dev/null
@@ -1,70 +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.core.jpa.repository;
-
-import org.apache.shardingsphere.example.core.api.repository.OrderRepository;
-import org.apache.shardingsphere.example.core.api.entity.Order;
-import org.springframework.stereotype.Repository;
-
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.persistence.Query;
-import javax.transaction.Transactional;
-import java.util.List;
-
-@Repository
-@Transactional
-public class OrderRepositoryImpl implements OrderRepository {
-
- @PersistenceContext
- private EntityManager entityManager;
-
- @Override
- public void createTableIfNotExists() {
- throw new UnsupportedOperationException("createTableIfNotExists for JPA");
- }
-
- @Override
- public void truncateTable() {
- throw new UnsupportedOperationException("truncateTable for JPA");
- }
-
- @Override
- public void dropTable() {
- throw new UnsupportedOperationException("dropTable for JPA");
- }
-
- @Override
- public Long insert(final Order order) {
- entityManager.persist(order);
- return order.getOrderId();
- }
-
- @Override
- public void delete(final Long orderId) {
- Query query = entityManager.createQuery("DELETE FROM OrderEntity o WHERE o.orderId = ?1");
- query.setParameter(1, orderId);
- query.executeUpdate();
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public List<Order> selectAll() {
- return (List<Order>) entityManager.createQuery("SELECT o FROM OrderEntity o").getResultList();
- }
-}
diff --git a/examples/example-core/example-spring-jpa/src/main/java/org/apache/shardingsphere/example/core/jpa/repository/ShadowUserRepositoryImpl.java b/examples/example-core/example-spring-jpa/src/main/java/org/apache/shardingsphere/example/core/jpa/repository/ShadowUserRepositoryImpl.java
deleted file mode 100644
index e678d34..0000000
--- a/examples/example-core/example-spring-jpa/src/main/java/org/apache/shardingsphere/example/core/jpa/repository/ShadowUserRepositoryImpl.java
+++ /dev/null
@@ -1,78 +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.core.jpa.repository;
-
-import org.apache.shardingsphere.example.core.api.entity.ShadowUser;
-import org.apache.shardingsphere.example.core.api.repository.ShadowUserRepository;
-import org.springframework.stereotype.Repository;
-
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.persistence.Query;
-import javax.transaction.Transactional;
-import java.util.ArrayList;
-import java.util.List;
-
-@Repository
-@Transactional
-public class ShadowUserRepositoryImpl implements ShadowUserRepository {
-
- @PersistenceContext
- private EntityManager entityManager;
-
- @Override
- public void createTableIfNotExists() {
- throw new UnsupportedOperationException("createTableIfNotExists for JPA");
- }
-
- @Override
- public void dropTable() {
- throw new UnsupportedOperationException("dropTable for JPA");
- }
-
- @Override
- public void truncateTable() {
- throw new UnsupportedOperationException("truncateTable for JPA");
- }
-
- @Override
- public Long insert(final ShadowUser entity) {
- entityManager.persist(entity);
- return null;
- }
-
- @Override
- public void delete(final Long id) {
- Query query = entityManager.createQuery("DELETE FROM ShadowUserEntity o WHERE o.userId = ?1 and o.shadow = ?2");
- query.setParameter(1, id.intValue());
- query.setParameter(2, id % 2 == 0);
- query.executeUpdate();
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public List<ShadowUser> selectAll() {
- List<ShadowUser> users = new ArrayList<>();
- Query query = entityManager.createQuery("SELECT o FROM ShadowUserEntity o WHERE o.shadow = ?1");
- query.setParameter(1, true);
- users.addAll(query.getResultList());
- query.setParameter(1, false);
- users.addAll(query.getResultList());
- return users;
- }
-}
diff --git a/examples/example-core/example-spring-jpa/src/main/java/org/apache/shardingsphere/example/core/jpa/repository/UserRepositoryImpl.java b/examples/example-core/example-spring-jpa/src/main/java/org/apache/shardingsphere/example/core/jpa/repository/UserRepositoryImpl.java
deleted file mode 100644
index 6ae276f..0000000
--- a/examples/example-core/example-spring-jpa/src/main/java/org/apache/shardingsphere/example/core/jpa/repository/UserRepositoryImpl.java
+++ /dev/null
@@ -1,70 +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.core.jpa.repository;
-
-import org.apache.shardingsphere.example.core.api.repository.UserRepository;
-import org.apache.shardingsphere.example.core.api.entity.User;
-import org.springframework.stereotype.Repository;
-
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.persistence.Query;
-import javax.transaction.Transactional;
-import java.util.List;
-
-@Repository
-@Transactional
-public class UserRepositoryImpl implements UserRepository {
-
- @PersistenceContext
- private EntityManager entityManager;
-
- @Override
- public void createTableIfNotExists() {
- throw new UnsupportedOperationException("createTableIfNotExists for JPA");
- }
-
- @Override
- public void dropTable() {
- throw new UnsupportedOperationException("dropTable for JPA");
- }
-
- @Override
- public void truncateTable() {
- throw new UnsupportedOperationException("truncateTable for JPA");
- }
-
- @Override
- public Long insert(final User entity) {
- entityManager.persist(entity);
- return null;
- }
-
- @Override
- public void delete(final Long id) {
- Query query = entityManager.createQuery("DELETE FROM UserEntity o WHERE o.userId = ?1");
- query.setParameter(1, id.intValue());
- query.executeUpdate();
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public List<User> selectAll() {
- return (List<User>) entityManager.createQuery("SELECT o FROM UserEntity o").getResultList();
- }
-}
diff --git a/examples/example-core/example-spring-jpa/src/main/java/org/apache/shardingsphere/example/core/jpa/service/OrderServiceImpl.java b/examples/example-core/example-spring-jpa/src/main/java/org/apache/shardingsphere/example/core/jpa/service/OrderServiceImpl.java
deleted file mode 100644
index 246690b..0000000
--- a/examples/example-core/example-spring-jpa/src/main/java/org/apache/shardingsphere/example/core/jpa/service/OrderServiceImpl.java
+++ /dev/null
@@ -1,121 +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.core.jpa.service;
-
-import org.apache.shardingsphere.example.core.api.repository.AddressRepository;
-import org.apache.shardingsphere.example.core.api.repository.OrderItemRepository;
-import org.apache.shardingsphere.example.core.api.repository.OrderRepository;
-import org.apache.shardingsphere.example.core.api.service.ExampleService;
-import org.apache.shardingsphere.example.core.jpa.entity.AddressEntity;
-import org.apache.shardingsphere.example.core.jpa.entity.OrderEntity;
-import org.apache.shardingsphere.example.core.jpa.entity.OrderItemEntity;
-import org.springframework.context.annotation.Primary;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import javax.annotation.Resource;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.List;
-
-@Service
-@Primary
-public class OrderServiceImpl implements ExampleService {
-
- @Resource
- private OrderRepository orderRepository;
-
- @Resource
- private OrderItemRepository orderItemRepository;
-
- @Resource
- private AddressRepository addressRepository;
-
- @Override
- public void initEnvironment() throws SQLException {
- for (int i = 1; i <= 10; i++) {
- AddressEntity entity = new AddressEntity();
- entity.setAddressId((long) i);
- entity.setAddressName("address_" + i);
- addressRepository.insert(entity);
- }
- }
-
- @Override
- public void cleanEnvironment() {
- }
-
- @Override
- @Transactional
- public void processSuccess() throws SQLException {
- System.out.println("-------------- Process Success Begin ---------------");
- List<Long> orderIds = insertData();
- printData();
- deleteData(orderIds);
- printData();
- System.out.println("-------------- Process Success Finish --------------");
- }
-
- @Override
- @Transactional
- public void processFailure() throws SQLException {
- System.out.println("-------------- Process Failure Begin ---------------");
- insertData();
- System.out.println("-------------- Process Failure Finish --------------");
- throw new RuntimeException("Exception occur for transaction test.");
- }
-
- private List<Long> insertData() throws SQLException {
- System.out.println("---------------------------- Insert Data ----------------------------");
- List<Long> result = new ArrayList<>(10);
- for (int i = 1; i <= 10; i++) {
- OrderEntity order = new OrderEntity();
- order.setUserId(i);
- order.setAddressId(i);
- order.setStatus("INSERT_TEST_JPA");
- orderRepository.insert(order);
- OrderItemEntity item = new OrderItemEntity();
- item.setOrderId(order.getOrderId());
- item.setUserId(i);
- item.setStatus("INSERT_TEST_JPA");
- orderItemRepository.insert(item);
- result.add(order.getOrderId());
- }
- return result;
- }
-
- private void deleteData(final List<Long> orderIds) throws SQLException {
- System.out.println("---------------------------- Delete Data ----------------------------");
- for (Long each : orderIds) {
- orderRepository.delete(each);
- orderItemRepository.delete(each);
- }
- }
-
- @Override
- public void printData() throws SQLException {
- System.out.println("---------------------------- Print Order Data -----------------------");
- for (Object each : orderRepository.selectAll()) {
- System.out.println(each);
- }
- System.out.println("---------------------------- Print OrderItem Data -------------------");
- for (Object each : orderItemRepository.selectAll()) {
- System.out.println(each);
- }
- }
-}
diff --git a/examples/example-core/example-spring-jpa/src/main/java/org/apache/shardingsphere/example/core/jpa/service/ShadowUserServiceImpl.java b/examples/example-core/example-spring-jpa/src/main/java/org/apache/shardingsphere/example/core/jpa/service/ShadowUserServiceImpl.java
deleted file mode 100644
index 73c3685..0000000
--- a/examples/example-core/example-spring-jpa/src/main/java/org/apache/shardingsphere/example/core/jpa/service/ShadowUserServiceImpl.java
+++ /dev/null
@@ -1,94 +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.core.jpa.service;
-
-import org.apache.shardingsphere.example.core.api.repository.ShadowUserRepository;
-import org.apache.shardingsphere.example.core.api.service.ExampleService;
-import org.apache.shardingsphere.example.core.jpa.entity.ShadowUserEntity;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import javax.annotation.Resource;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.List;
-
-@Service("shadowExample")
-public class ShadowUserServiceImpl implements ExampleService {
-
- @Resource
- private ShadowUserRepository userRepository;
-
- @Override
- public void initEnvironment() {
- }
-
- @Override
- public void cleanEnvironment() {
- }
-
- @Override
- @Transactional
- public void processSuccess() throws SQLException {
- System.out.println("-------------- Process Success Begin ---------------");
- List<Long> userIds = insertData();
- printData();
- deleteData(userIds);
- printData();
- System.out.println("-------------- Process Success Finish --------------");
- }
-
- @Override
- @Transactional
- public void processFailure() throws SQLException {
- System.out.println("-------------- Process Failure Begin ---------------");
- insertData();
- System.out.println("-------------- Process Failure Finish --------------");
- throw new RuntimeException("Exception occur for transaction test.");
- }
-
- private List<Long> insertData() throws SQLException {
- System.out.println("---------------------------- Insert Data ----------------------------");
- List<Long> result = new ArrayList<>(10);
- for (int i = 1; i <= 10; i++) {
- ShadowUserEntity user = new ShadowUserEntity();
- user.setUserId(i);
- user.setUserName("test_jpa_" + i);
- user.setPwd("pwd_jpa_" + i);
- user.setShadow(i % 2 == 0);
- userRepository.insert(user);
- result.add((long) user.getUserId());
- }
- return result;
- }
-
- private void deleteData(final List<Long> userIds) throws SQLException {
- System.out.println("---------------------------- Delete Data ----------------------------");
- for (Long each : userIds) {
- userRepository.delete(each);
- }
- }
-
- @Override
- public void printData() throws SQLException {
- System.out.println("---------------------------- Print User Data -----------------------");
- for (Object each : userRepository.selectAll()) {
- System.out.println(each);
- }
- }
-}
diff --git a/examples/example-core/example-spring-jpa/src/main/java/org/apache/shardingsphere/example/core/jpa/service/UserServiceImpl.java b/examples/example-core/example-spring-jpa/src/main/java/org/apache/shardingsphere/example/core/jpa/service/UserServiceImpl.java
deleted file mode 100644
index a6b7bc6..0000000
--- a/examples/example-core/example-spring-jpa/src/main/java/org/apache/shardingsphere/example/core/jpa/service/UserServiceImpl.java
+++ /dev/null
@@ -1,93 +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.core.jpa.service;
-
-import org.apache.shardingsphere.example.core.api.repository.UserRepository;
-import org.apache.shardingsphere.example.core.api.service.ExampleService;
-import org.apache.shardingsphere.example.core.jpa.entity.UserEntity;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import javax.annotation.Resource;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.List;
-
-@Service("encryptExample")
-public class UserServiceImpl implements ExampleService {
-
- @Resource
- private UserRepository userRepository;
-
- @Override
- public void initEnvironment() {
- }
-
- @Override
- public void cleanEnvironment() {
- }
-
- @Override
- @Transactional
- public void processSuccess() throws SQLException {
- System.out.println("-------------- Process Success Begin ---------------");
- List<Long> userIds = insertData();
- printData();
- deleteData(userIds);
- printData();
- System.out.println("-------------- Process Success Finish --------------");
- }
-
- @Override
- @Transactional
- public void processFailure() throws SQLException {
- System.out.println("-------------- Process Failure Begin ---------------");
- insertData();
- System.out.println("-------------- Process Failure Finish --------------");
- throw new RuntimeException("Exception occur for transaction test.");
- }
-
- private List<Long> insertData() throws SQLException {
- System.out.println("---------------------------- Insert Data ----------------------------");
- List<Long> result = new ArrayList<>(10);
- for (int i = 1; i <= 10; i++) {
- UserEntity user = new UserEntity();
- user.setUserId(i);
- user.setUserName("test_jpa_" + i);
- user.setPwd("pwd_jpa_" + i);
- userRepository.insert(user);
- result.add((long) user.getUserId());
- }
- return result;
- }
-
- private void deleteData(final List<Long> userIds) throws SQLException {
- System.out.println("---------------------------- Delete Data ----------------------------");
- for (Long each : userIds) {
- userRepository.delete(each);
- }
- }
-
- @Override
- public void printData() throws SQLException {
- System.out.println("---------------------------- Print User Data -----------------------");
- for (Object each : userRepository.selectAll()) {
- System.out.println(each);
- }
- }
-}
diff --git a/examples/example-core/example-spring-mybatis/pom.xml b/examples/example-core/example-spring-mybatis/pom.xml
deleted file mode 100644
index fca649e..0000000
--- a/examples/example-core/example-spring-mybatis/pom.xml
+++ /dev/null
@@ -1,59 +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>example-core</artifactId>
- <version>5.0.0-RC1-SNAPSHOT</version>
- </parent>
- <artifactId>example-spring-mybatis</artifactId>
- <name>common::example-spring-mybatis</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.shardingsphere.example</groupId>
- <artifactId>config-utility</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.shardingsphere.example</groupId>
- <artifactId>example-api</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.mybatis</groupId>
- <artifactId>mybatis</artifactId>
- </dependency>
- <dependency>
- <groupId>org.mybatis</groupId>
- <artifactId>mybatis-spring</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-orm</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context-support</artifactId>
- </dependency>
- </dependencies>
-</project>
diff --git a/examples/example-core/example-spring-mybatis/src/main/java/org/apache/shardingsphere/example/core/mybatis/repository/MybatisAddressRepository.java b/examples/example-core/example-spring-mybatis/src/main/java/org/apache/shardingsphere/example/core/mybatis/repository/MybatisAddressRepository.java
deleted file mode 100644
index 749a33e..0000000
--- a/examples/example-core/example-spring-mybatis/src/main/java/org/apache/shardingsphere/example/core/mybatis/repository/MybatisAddressRepository.java
+++ /dev/null
@@ -1,25 +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.core.mybatis.repository;
-
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.shardingsphere.example.core.api.repository.AddressRepository;
-
-@Mapper
-public interface MybatisAddressRepository extends AddressRepository {
-}
diff --git a/examples/example-core/example-spring-mybatis/src/main/java/org/apache/shardingsphere/example/core/mybatis/repository/MybatisOrderItemRepository.java b/examples/example-core/example-spring-mybatis/src/main/java/org/apache/shardingsphere/example/core/mybatis/repository/MybatisOrderItemRepository.java
deleted file mode 100644
index d070bd9..0000000
--- a/examples/example-core/example-spring-mybatis/src/main/java/org/apache/shardingsphere/example/core/mybatis/repository/MybatisOrderItemRepository.java
+++ /dev/null
@@ -1,25 +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.core.mybatis.repository;
-
-import org.apache.shardingsphere.example.core.api.repository.OrderItemRepository;
-import org.apache.ibatis.annotations.Mapper;
-
-@Mapper
-public interface MybatisOrderItemRepository extends OrderItemRepository {
-}
diff --git a/examples/example-core/example-spring-mybatis/src/main/java/org/apache/shardingsphere/example/core/mybatis/repository/MybatisOrderRepository.java b/examples/example-core/example-spring-mybatis/src/main/java/org/apache/shardingsphere/example/core/mybatis/repository/MybatisOrderRepository.java
deleted file mode 100644
index 7ce783f..0000000
--- a/examples/example-core/example-spring-mybatis/src/main/java/org/apache/shardingsphere/example/core/mybatis/repository/MybatisOrderRepository.java
+++ /dev/null
@@ -1,25 +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.core.mybatis.repository;
-
-import org.apache.shardingsphere.example.core.api.repository.OrderRepository;
-import org.apache.ibatis.annotations.Mapper;
-
-@Mapper
-public interface MybatisOrderRepository extends OrderRepository {
-}
diff --git a/examples/example-core/example-spring-mybatis/src/main/java/org/apache/shardingsphere/example/core/mybatis/repository/MybatisShadowUserRepository.java b/examples/example-core/example-spring-mybatis/src/main/java/org/apache/shardingsphere/example/core/mybatis/repository/MybatisShadowUserRepository.java
deleted file mode 100644
index 913f5da..0000000
--- a/examples/example-core/example-spring-mybatis/src/main/java/org/apache/shardingsphere/example/core/mybatis/repository/MybatisShadowUserRepository.java
+++ /dev/null
@@ -1,40 +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.core.mybatis.repository;
-
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.shardingsphere.example.core.api.entity.ShadowUser;
-import org.apache.shardingsphere.example.core.api.repository.ShadowUserRepository;
-
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.List;
-
-@Mapper
-public interface MybatisShadowUserRepository extends ShadowUserRepository {
-
- @Override
- default List<ShadowUser> selectAll() throws SQLException {
- List<ShadowUser> result = new ArrayList<>();
- result.addAll(selectAllByShadow(true));
- result.addAll(selectAllByShadow(false));
- return result;
- }
-
- List<ShadowUser> selectAllByShadow(boolean shadow) throws SQLException;
-}
diff --git a/examples/example-core/example-spring-mybatis/src/main/java/org/apache/shardingsphere/example/core/mybatis/repository/MybatisUserRepository.java b/examples/example-core/example-spring-mybatis/src/main/java/org/apache/shardingsphere/example/core/mybatis/repository/MybatisUserRepository.java
deleted file mode 100644
index 5b3682b..0000000
--- a/examples/example-core/example-spring-mybatis/src/main/java/org/apache/shardingsphere/example/core/mybatis/repository/MybatisUserRepository.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.core.mybatis.repository;
-
-import org.apache.shardingsphere.example.core.api.repository.UserRepository;
-
-public interface MybatisUserRepository extends UserRepository {
-}
diff --git a/examples/example-core/example-spring-mybatis/src/main/java/org/apache/shardingsphere/example/core/mybatis/service/OrderServiceImpl.java b/examples/example-core/example-spring-mybatis/src/main/java/org/apache/shardingsphere/example/core/mybatis/service/OrderServiceImpl.java
deleted file mode 100644
index 6320eac..0000000
--- a/examples/example-core/example-spring-mybatis/src/main/java/org/apache/shardingsphere/example/core/mybatis/service/OrderServiceImpl.java
+++ /dev/null
@@ -1,133 +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.core.mybatis.service;
-
-import org.apache.shardingsphere.example.core.api.entity.Address;
-import org.apache.shardingsphere.example.core.api.entity.Order;
-import org.apache.shardingsphere.example.core.api.entity.OrderItem;
-import org.apache.shardingsphere.example.core.api.repository.AddressRepository;
-import org.apache.shardingsphere.example.core.api.repository.OrderItemRepository;
-import org.apache.shardingsphere.example.core.api.repository.OrderRepository;
-import org.apache.shardingsphere.example.core.api.service.ExampleService;
-import org.springframework.context.annotation.Primary;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import javax.annotation.Resource;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.List;
-
-@Service
-@Primary
-public class OrderServiceImpl implements ExampleService {
-
- @Resource
- private OrderRepository orderRepository;
-
- @Resource
- private OrderItemRepository orderItemRepository;
-
- @Resource
- private AddressRepository addressRepository;
-
- @Override
- public void initEnvironment() throws SQLException {
- orderRepository.createTableIfNotExists();
- orderItemRepository.createTableIfNotExists();
- orderRepository.truncateTable();
- orderItemRepository.truncateTable();
- initAddressTable();
- }
-
- private void initAddressTable() throws SQLException {
- addressRepository.createTableIfNotExists();
- addressRepository.truncateTable();
- for (int i = 1; i <= 10; i++) {
- Address entity = new Address();
- entity.setAddressId((long) i);
- entity.setAddressName("address_" + i);
- addressRepository.insert(entity);
- }
- }
-
- @Override
- public void cleanEnvironment() throws SQLException {
- orderRepository.dropTable();
- orderItemRepository.dropTable();
- }
-
- @Override
- @Transactional
- public void processSuccess() throws SQLException {
- System.out.println("-------------- Process Success Begin ---------------");
- List<Long> orderIds = insertData();
- printData();
- deleteData(orderIds);
- printData();
- System.out.println("-------------- Process Success Finish --------------");
- }
-
- @Override
- @Transactional
- public void processFailure() throws SQLException {
- System.out.println("-------------- Process Failure Begin ---------------");
- insertData();
- System.out.println("-------------- Process Failure Finish --------------");
- throw new RuntimeException("Exception occur for transaction test.");
- }
-
- private List<Long> insertData() throws SQLException {
- System.out.println("---------------------------- Insert Data ----------------------------");
- List<Long> result = new ArrayList<>(10);
- for (int i = 1; i <= 10; i++) {
- Order order = new Order();
- order.setUserId(i);
- order.setAddressId(i);
- order.setStatus("INSERT_TEST");
- orderRepository.insert(order);
- OrderItem item = new OrderItem();
- item.setOrderId(order.getOrderId());
- item.setUserId(i);
- item.setStatus("INSERT_TEST");
- orderItemRepository.insert(item);
- result.add(order.getOrderId());
- }
- return result;
- }
-
- private void deleteData(final List<Long> orderIds) throws SQLException {
- System.out.println("---------------------------- Delete Data ----------------------------");
- for (Long each : orderIds) {
- orderRepository.delete(each);
- orderItemRepository.delete(each);
- }
- }
-
- @Override
- public void printData() throws SQLException {
- System.out.println("---------------------------- Print Order Data -----------------------");
- for (Object each : orderRepository.selectAll()) {
- System.out.println(each);
- }
- System.out.println("---------------------------- Print OrderItem Data -------------------");
- for (Object each : orderItemRepository.selectAll()) {
- System.out.println(each);
- }
- }
-}
diff --git a/examples/example-core/example-spring-mybatis/src/main/java/org/apache/shardingsphere/example/core/mybatis/service/ShadowUserServiceImpl.java b/examples/example-core/example-spring-mybatis/src/main/java/org/apache/shardingsphere/example/core/mybatis/service/ShadowUserServiceImpl.java
deleted file mode 100644
index f5e06c5..0000000
--- a/examples/example-core/example-spring-mybatis/src/main/java/org/apache/shardingsphere/example/core/mybatis/service/ShadowUserServiceImpl.java
+++ /dev/null
@@ -1,94 +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.core.mybatis.service;
-
-import org.apache.shardingsphere.example.core.api.entity.ShadowUser;
-import org.apache.shardingsphere.example.core.api.repository.ShadowUserRepository;
-import org.apache.shardingsphere.example.core.api.service.ExampleService;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.List;
-
-@Service("shadow")
-public class ShadowUserServiceImpl implements ExampleService {
-
- @Resource
- private ShadowUserRepository userRepository;
-
- @Override
- public void initEnvironment() throws SQLException {
- userRepository.createTableIfNotExists();
- userRepository.truncateTable();
- }
-
- @Override
- public void cleanEnvironment() throws SQLException {
- userRepository.dropTable();
- }
-
- @Override
- public void processSuccess() throws SQLException {
- System.out.println("-------------- Process Success Begin ---------------");
- List<Long> userIds = insertData();
- printData();
- deleteData(userIds);
- printData();
- System.out.println("-------------- Process Success Finish --------------");
- }
-
- private List<Long> insertData() throws SQLException {
- System.out.println("---------------------------- Insert Data ----------------------------");
- List<Long> result = new ArrayList<>(10);
- for (int i = 1; i <= 10; i++) {
- ShadowUser user = new ShadowUser();
- user.setUserId(i);
- user.setUserName("test_mybatis_" + i);
- user.setPwd("pwd_mybatis_" + i);
- user.setShadow(i % 2 == 0);
- userRepository.insert(user);
- result.add((long) user.getUserId());
- }
- return result;
- }
-
- @Override
- public void processFailure() throws SQLException {
- System.out.println("-------------- Process Failure Begin ---------------");
- insertData();
- System.out.println("-------------- Process Failure Finish --------------");
- throw new RuntimeException("Exception occur for transaction test.");
- }
-
- private void deleteData(final List<Long> userIds) throws SQLException {
- System.out.println("---------------------------- Delete Data ----------------------------");
- for (Long each : userIds) {
- userRepository.delete(each);
- }
- }
-
- @Override
- public void printData() throws SQLException {
- System.out.println("---------------------------- Print User Data -----------------------");
- for (Object each : userRepository.selectAll()) {
- System.out.println(each);
- }
- }
-}
diff --git a/examples/example-core/example-spring-mybatis/src/main/java/org/apache/shardingsphere/example/core/mybatis/service/UserServiceImpl.java b/examples/example-core/example-spring-mybatis/src/main/java/org/apache/shardingsphere/example/core/mybatis/service/UserServiceImpl.java
deleted file mode 100644
index 9816e73..0000000
--- a/examples/example-core/example-spring-mybatis/src/main/java/org/apache/shardingsphere/example/core/mybatis/service/UserServiceImpl.java
+++ /dev/null
@@ -1,93 +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.core.mybatis.service;
-
-import org.apache.shardingsphere.example.core.api.repository.UserRepository;
-import org.apache.shardingsphere.example.core.api.entity.User;
-import org.apache.shardingsphere.example.core.api.service.ExampleService;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.List;
-
-@Service("encrypt")
-public class UserServiceImpl implements ExampleService {
-
- @Resource
- private UserRepository userRepository;
-
- @Override
- public void initEnvironment() throws SQLException {
- userRepository.createTableIfNotExists();
- userRepository.truncateTable();
- }
-
- @Override
- public void cleanEnvironment() throws SQLException {
- userRepository.dropTable();
- }
-
- @Override
- public void processSuccess() throws SQLException {
- System.out.println("-------------- Process Success Begin ---------------");
- List<Long> userIds = insertData();
- printData();
- deleteData(userIds);
- printData();
- System.out.println("-------------- Process Success Finish --------------");
- }
-
- private List<Long> insertData() throws SQLException {
- System.out.println("---------------------------- Insert Data ----------------------------");
- List<Long> result = new ArrayList<>(10);
- for (int i = 1; i <= 10; i++) {
- User user = new User();
- user.setUserId(i);
- user.setUserName("test_mybatis_" + i);
- user.setPwd("pwd_mybatis_" + i);
- userRepository.insert(user);
- result.add((long) user.getUserId());
- }
- return result;
- }
-
- @Override
- public void processFailure() throws SQLException {
- System.out.println("-------------- Process Failure Begin ---------------");
- insertData();
- System.out.println("-------------- Process Failure Finish --------------");
- throw new RuntimeException("Exception occur for transaction test.");
- }
-
- private void deleteData(final List<Long> userIds) throws SQLException {
- System.out.println("---------------------------- Delete Data ----------------------------");
- for (Long each : userIds) {
- userRepository.delete(each);
- }
- }
-
- @Override
- public void printData() throws SQLException {
- System.out.println("---------------------------- Print User Data -----------------------");
- for (Object each : userRepository.selectAll()) {
- System.out.println(each);
- }
- }
-}
diff --git a/examples/example-core/example-spring-mybatis/src/main/resources/META-INF/mappers/AddressMapper.xml b/examples/example-core/example-spring-mybatis/src/main/resources/META-INF/mappers/AddressMapper.xml
deleted file mode 100644
index 2ade012..0000000
--- a/examples/example-core/example-spring-mybatis/src/main/resources/META-INF/mappers/AddressMapper.xml
+++ /dev/null
@@ -1,50 +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.
- -->
-
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="org.apache.shardingsphere.example.core.mybatis.repository.MybatisAddressRepository">
- <resultMap id="baseResultMap" type="org.apache.shardingsphere.example.core.api.entity.Address">
- <result column="address_id" property="addressId" jdbcType="BIGINT"/>
- <result column="address_name" property="addressName" jdbcType="VARCHAR"/>
- </resultMap>
-
- <update id="createTableIfNotExists">
- CREATE TABLE IF NOT EXISTS t_address (address_id BIGINT NOT NULL, address_name VARCHAR(100) NOT NULL, PRIMARY KEY (address_id));
- </update>
-
- <update id="truncateTable">
- TRUNCATE TABLE t_address;
- </update>
-
- <update id="dropTable">
- DROP TABLE IF EXISTS t_address;
- </update>
-
- <insert id="insert">
- INSERT INTO t_address (address_id, address_name) VALUES (#{addressId,jdbcType=BIGINT}, #{addressName,jdbcType=VARCHAR});
- </insert>
-
- <delete id="delete">
- DELETE FROM t_address WHERE address_id = #{addressId,jdbcType=BIGINT};
- </delete>
-
- <select id="selectAll" resultMap="baseResultMap">
- SELECT * FROM t_address;
- </select>
-
-</mapper>
diff --git a/examples/example-core/example-spring-mybatis/src/main/resources/META-INF/mappers/OrderItemMapper.xml b/examples/example-core/example-spring-mybatis/src/main/resources/META-INF/mappers/OrderItemMapper.xml
deleted file mode 100644
index 48aae45..0000000
--- a/examples/example-core/example-spring-mybatis/src/main/resources/META-INF/mappers/OrderItemMapper.xml
+++ /dev/null
@@ -1,55 +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.
- -->
-
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="org.apache.shardingsphere.example.core.mybatis.repository.MybatisOrderItemRepository">
- <resultMap id="baseResultMap" type="org.apache.shardingsphere.example.core.api.entity.OrderItem">
- <result column="order_item_id" property="orderItemId" jdbcType="INTEGER"/>
- <result column="order_id" property="orderId" jdbcType="INTEGER"/>
- <result column="user_id" property="userId" jdbcType="INTEGER"/>
- <result column="status" property="status" jdbcType="VARCHAR"/>
- </resultMap>
-
- <update id="createTableIfNotExists">
- CREATE TABLE IF NOT EXISTS t_order_item (order_item_id BIGINT AUTO_INCREMENT, order_id BIGINT, user_id INT NOT NULL, status VARCHAR(50) , PRIMARY KEY (order_item_id));
- </update>
-
- <update id="truncateTable">
- TRUNCATE TABLE t_order_item;
- </update>
-
- <update id="dropTable">
- DROP TABLE IF EXISTS t_order_item;
- </update>
-
- <insert id="insert" useGeneratedKeys="true" keyProperty="orderItemId">
- INSERT INTO t_order_item (order_id, user_id, status) VALUES (#{orderId,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER}, #{status,jdbcType=VARCHAR});
- </insert>
-
- <delete id="delete">
- DELETE FROM t_order_item WHERE order_id = #{orderId,jdbcType=INTEGER};
- </delete>
-
- <select id="selectAll" resultMap="baseResultMap">
- SELECT * from t_order_item
- </select>
-
- <select id="selectRange" resultMap="baseResultMap">
- SELECT i.* FROM t_order o, t_order_item i WHERE o.order_id = i.order_id AND o.user_id BETWEEN 1 AND 5
- </select>
-</mapper>
diff --git a/examples/example-core/example-spring-mybatis/src/main/resources/META-INF/mappers/OrderMapper.xml b/examples/example-core/example-spring-mybatis/src/main/resources/META-INF/mappers/OrderMapper.xml
deleted file mode 100644
index d32c53c..0000000
--- a/examples/example-core/example-spring-mybatis/src/main/resources/META-INF/mappers/OrderMapper.xml
+++ /dev/null
@@ -1,55 +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.
- -->
-
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="org.apache.shardingsphere.example.core.mybatis.repository.MybatisOrderRepository">
- <resultMap id="baseResultMap" type="org.apache.shardingsphere.example.core.api.entity.Order">
- <result column="order_id" property="orderId" jdbcType="BIGINT"/>
- <result column="user_id" property="userId" jdbcType="INTEGER"/>
- <result column="address_id" property="addressId" jdbcType="BIGINT"/>
- <result column="status" property="status" jdbcType="VARCHAR"/>
- </resultMap>
-
- <update id="createTableIfNotExists">
- CREATE TABLE IF NOT EXISTS t_order (order_id BIGINT AUTO_INCREMENT, user_id INT NOT NULL, address_id BIGINT NOT NULL, status VARCHAR(50), PRIMARY KEY (order_id));
- </update>
-
- <update id="truncateTable">
- TRUNCATE TABLE t_order;
- </update>
-
- <update id="dropTable">
- DROP TABLE IF EXISTS t_order;
- </update>
-
- <insert id="insert" useGeneratedKeys="true" keyProperty="orderId">
- INSERT INTO t_order (user_id, address_id, status) VALUES (#{userId,jdbcType=INTEGER}, #{addressId,jdbcType=BIGINT}, #{status,jdbcType=VARCHAR});
- </insert>
-
- <delete id="delete">
- DELETE FROM t_order WHERE order_id = #{orderId,jdbcType=INTEGER};
- </delete>
-
- <select id="selectAll" resultMap="baseResultMap">
- SELECT * FROM t_order;
- </select>
-
- <select id="selectRange" resultMap="baseResultMap">
- SELECT * FROM t_order WHERE order_id BETWEEN 200000000000000000 AND 400000000000000000
- </select>
-</mapper>
diff --git a/examples/example-core/example-spring-mybatis/src/main/resources/META-INF/mappers/ShadowUserMapper.xml b/examples/example-core/example-spring-mybatis/src/main/resources/META-INF/mappers/ShadowUserMapper.xml
deleted file mode 100644
index 0ad5b39..0000000
--- a/examples/example-core/example-spring-mybatis/src/main/resources/META-INF/mappers/ShadowUserMapper.xml
+++ /dev/null
@@ -1,56 +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.
- -->
-
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="org.apache.shardingsphere.example.core.mybatis.repository.MybatisShadowUserRepository">
- <resultMap id="baseResultMap" type="org.apache.shardingsphere.example.core.api.entity.ShadowUser">
- <result column="user_id" property="userId" jdbcType="INTEGER"/>
- <result column="user_name" property="userName" jdbcType="VARCHAR"/>
- <result column="pwd" property="pwd" jdbcType="VARCHAR"/>
- <result column="assisted_query_pwd" property="assistedQueryPwd" jdbcType="VARCHAR"/>
- <result column="shadow" property="shadow" jdbcType="BOOLEAN"/>
- </resultMap>
-
- <update id="createTableIfNotExists">
- CREATE TABLE IF NOT EXISTS t_user (user_id INT NOT NULL AUTO_INCREMENT, user_name VARCHAR(200), pwd VARCHAR(200), PRIMARY KEY (user_id));
- </update>
-
- <update id="truncateTable">
- TRUNCATE TABLE t_user;
- </update>
-
- <update id="dropTable">
- DROP TABLE IF EXISTS t_user;
- </update>
-
- <insert id="insert">
- INSERT INTO t_user (user_id, user_name, pwd, shadow) VALUES (#{userId,jdbcType=INTEGER}, #{userName,jdbcType=VARCHAR}, #{pwd,jdbcType=VARCHAR}, #{shadow,jdbcType=BOOLEAN})
- </insert>
-
- <delete id="delete">
- DELETE FROM t_user WHERE user_id = #{userId,jdbcType=INTEGER} AND shadow = #{shadow,jdbcType=BOOLEAN};
- </delete>
-
- <select id="selectAll" resultMap="baseResultMap">
- SELECT * FROM t_user;
- </select>
-
- <select id="selectAllByShadow" resultMap="baseResultMap">
- SELECT * FROM t_user WHERE shadow = #{shadow,jdbcType=BOOLEAN};
- </select>
-</mapper>
diff --git a/examples/example-core/example-spring-mybatis/src/main/resources/META-INF/mappers/UserMapper.xml b/examples/example-core/example-spring-mybatis/src/main/resources/META-INF/mappers/UserMapper.xml
deleted file mode 100644
index 28359ca..0000000
--- a/examples/example-core/example-spring-mybatis/src/main/resources/META-INF/mappers/UserMapper.xml
+++ /dev/null
@@ -1,51 +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.
- -->
-
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="org.apache.shardingsphere.example.core.mybatis.repository.MybatisUserRepository">
- <resultMap id="baseResultMap" type="org.apache.shardingsphere.example.core.api.entity.User">
- <result column="user_id" property="userId" jdbcType="INTEGER"/>
- <result column="user_name" property="userName" jdbcType="VARCHAR"/>
- <result column="pwd" property="pwd" jdbcType="VARCHAR"/>
- <result column="assisted_query_pwd" property="assistedQueryPwd" jdbcType="VARCHAR"/>
- </resultMap>
-
- <update id="createTableIfNotExists">
- CREATE TABLE IF NOT EXISTS t_user (user_id INT NOT NULL AUTO_INCREMENT, user_name VARCHAR(200), pwd VARCHAR(200), PRIMARY KEY (user_id));
- </update>
-
- <update id="truncateTable">
- TRUNCATE TABLE t_user;
- </update>
-
- <update id="dropTable">
- DROP TABLE IF EXISTS t_user;
- </update>
-
- <insert id="insert">
- INSERT INTO t_user (user_id, user_name, pwd) VALUES (#{userId,jdbcType=INTEGER}, #{userName,jdbcType=VARCHAR}, #{pwd,jdbcType=VARCHAR})
- </insert>
-
- <delete id="delete">
- DELETE FROM t_user WHERE user_id = #{userId,jdbcType=INTEGER};
- </delete>
-
- <select id="selectAll" resultMap="baseResultMap">
- SELECT * FROM t_user;
- </select>
-</mapper>
diff --git a/examples/example-core/pom.xml b/examples/example-core/pom.xml
deleted file mode 100644
index 8c4e420..0000000
--- a/examples/example-core/pom.xml
+++ /dev/null
@@ -1,39 +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-example</artifactId>
- <version>5.0.0-RC1-SNAPSHOT</version>
- </parent>
- <artifactId>example-core</artifactId>
- <packaging>pom</packaging>
- <name>${project.artifactId}</name>
-
- <modules>
- <module>config-utility</module>
- <module>example-api</module>
- <module>example-raw-jdbc</module>
- <module>example-spring-mybatis</module>
- <module>example-spring-jpa</module>
- </modules>
-</project>
diff --git a/examples/pom.xml b/examples/pom.xml
deleted file mode 100644
index f1f9f4e..0000000
--- a/examples/pom.xml
+++ /dev/null
@@ -1,428 +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>
- <groupId>org.apache.shardingsphere.example</groupId>
- <artifactId>shardingsphere-example</artifactId>
- <version>5.0.0-RC1-SNAPSHOT</version>
- <packaging>pom</packaging>
- <name>${project.artifactId}</name>
-
- <modules>
- <module>example-core</module>
- <module>shardingsphere-jdbc-example</module>
- <module>shardingsphere-proxy-example</module>
- <module>shardingsphere-parser-example</module>
- </modules>
-
- <properties>
- <java.version>1.8</java.version>
- <maven.version.range>[3.0.4,)</maven.version.range>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <project.build.locale>zh_CN</project.build.locale>
-
- <shardingsphere.version>5.0.0-RC1-SNAPSHOT</shardingsphere.version>
-
- <aspectjweaver.version>1.8.9</aspectjweaver.version>
- <spring-framework.version>5.0.13.RELEASE</spring-framework.version>
- <spring-boot.version>2.0.9.RELEASE</spring-boot.version>
- <hikari-cp.version>3.4.2</hikari-cp.version>
- <mysql-connector-java.version>5.1.47</mysql-connector-java.version>
- <postgresql.version>42.2.5</postgresql.version>
- <h2.version>1.4.196</h2.version>
- <slf4j.version>1.7.7</slf4j.version>
- <logback.version>1.2.0</logback.version>
- <lombok.version>1.18.16</lombok.version>
- <mybatis.version>3.5.1</mybatis.version>
- <mybatis-spring.version>2.0.1</mybatis-spring.version>
-
- <jpa.version>1.0.0.Final</jpa.version>
- <hibernate.version>5.2.18.Final</hibernate.version>
- <narayana.version>5.9.1.Final</narayana.version>
- <jboss-transaction-spi.version>7.6.0.Final</jboss-transaction-spi.version>
- <jboss-logging.version>3.2.1.Final</jboss-logging.version>
- <btm.version>2.1.3</btm.version>
-
- <seata.version>1.0.0</seata.version>
-
- <junit.version>4.12</junit.version>
- <hamcrest.version>1.3</hamcrest.version>
- <mockito.version>2.7.21</mockito.version>
-
- <apache-rat-plugin.version>0.12</apache-rat-plugin.version>
- <maven-compiler-plugin.version>3.3</maven-compiler-plugin.version>
- <maven-resources-plugin.version>2.7</maven-resources-plugin.version>
- <maven-jar-plugin.version>2.6</maven-jar-plugin.version>
- <maven-source-plugin.version>2.4</maven-source-plugin.version>
-
- <javadocExecutable>${java.home}/../bin/javadoc</javadocExecutable>
- </properties>
-
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-sharding-core</artifactId>
- <version>${shardingsphere.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-encrypt-core</artifactId>
- <version>${shardingsphere.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-jdbc-core</artifactId>
- <version>${shardingsphere.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-transaction-core</artifactId>
- <version>${shardingsphere.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-transaction-xa-core</artifactId>
- <version>${shardingsphere.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-transaction-xa-bitronix</artifactId>
- <version>${shardingsphere.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-transaction-xa-narayana</artifactId>
- <version>${shardingsphere.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-transaction-base-seata-at</artifactId>
- <version>${shardingsphere.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-jdbc-core-spring-boot-starter</artifactId>
- <version>${shardingsphere.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-jdbc-governance-spring-boot-starter</artifactId>
- <version>${shardingsphere.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-jdbc-core-spring-namespace</artifactId>
- <version>${shardingsphere.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-cluster-mode-repository-zookeeper-curator</artifactId>
- <version>${shardingsphere.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-cluster-mode-repository-etcd</artifactId>
- <version>${shardingsphere.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-infra-common</artifactId>
- <version>${shardingsphere.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.aspectj</groupId>
- <artifactId>aspectjweaver</artifactId>
- <version>${aspectjweaver.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-orm</artifactId>
- <version>${spring-framework.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context-support</artifactId>
- <version>${spring-framework.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-tx</artifactId>
- <version>${spring-framework.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-jdbc</artifactId>
- <version>${spring-framework.version}</version>
- </dependency>
- <dependency>
- <groupId>org.hibernate.javax.persistence</groupId>
- <artifactId>hibernate-jpa-2.1-api</artifactId>
- <version>${jpa.version}</version>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-core</artifactId>
- <version>${hibernate.version}</version>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-entitymanager</artifactId>
- <version>${hibernate.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-data-jpa</artifactId>
- <version>${spring-boot.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-aop</artifactId>
- <version>${spring-boot.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-jdbc</artifactId>
- <version>${spring-boot.version}</version>
- </dependency>
- <dependency>
- <groupId>org.mybatis</groupId>
- <artifactId>mybatis</artifactId>
- <version>${mybatis.version}</version>
- </dependency>
- <dependency>
- <groupId>org.mybatis</groupId>
- <artifactId>mybatis-spring</artifactId>
- <version>${mybatis-spring.version}</version>
- </dependency>
- <dependency>
- <groupId>org.mybatis.spring.boot</groupId>
- <artifactId>mybatis-spring-boot-starter</artifactId>
- <version>${mybatis-spring.version}</version>
- </dependency>
- <dependency>
- <groupId>org.codehaus.btm</groupId>
- <artifactId>btm</artifactId>
- <version>${btm.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.narayana.jta</groupId>
- <artifactId>jta</artifactId>
- <version>${narayana.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.narayana.jts</groupId>
- <artifactId>narayana-jts-integration</artifactId>
- <version>${narayana.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-transaction-spi</artifactId>
- <version>${jboss-transaction-spi.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging</artifactId>
- <version>${jboss-logging.version}</version>
- </dependency>
- <dependency>
- <groupId>io.seata</groupId>
- <artifactId>seata-rm-datasource</artifactId>
- <version>${seata.version}</version>
- </dependency>
- <dependency>
- <groupId>io.seata</groupId>
- <artifactId>seata-tm</artifactId>
- <version>${seata.version}</version>
- </dependency>
- <dependency>
- <groupId>io.seata</groupId>
- <artifactId>seata-codec-all</artifactId>
- <version>${seata.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-test</artifactId>
- <version>${spring-boot.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-test</artifactId>
- <version>${spring-framework.version}</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
- </dependencyManagement>
-
- <dependencies>
- <dependency>
- <groupId>org.projectlombok</groupId>
- <artifactId>lombok</artifactId>
- <version>${lombok.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>com.zaxxer</groupId>
- <artifactId>HikariCP</artifactId>
- <version>${hikari-cp.version}</version>
- </dependency>
- <dependency>
- <groupId>mysql</groupId>
- <artifactId>mysql-connector-java</artifactId>
- <version>${mysql-connector-java.version}</version>
- </dependency>
- <dependency>
- <groupId>org.postgresql</groupId>
- <artifactId>postgresql</artifactId>
- <version>${postgresql.version}</version>
- </dependency>
- <dependency>
- <groupId>com.h2database</groupId>
- <artifactId>h2</artifactId>
- <version>${h2.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>jcl-over-slf4j</artifactId>
- <version>${slf4j.version}</version>
- </dependency>
- <dependency>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-classic</artifactId>
- <version>${logback.version}</version>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>${junit.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-library</artifactId>
- <version>${hamcrest.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <version>${mockito.version}</version>
- <scope>provided</scope>
- <exclusions>
- <exclusion>
- <groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-core</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-inline</artifactId>
- <version>${mockito.version}</version>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>${java.version}</source>
- <target>${java.version}</target>
- <testSource>${java.version}</testSource>
- <testTarget>${java.version}</testTarget>
- </configuration>
- <version>${maven-compiler-plugin.version}</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-resources-plugin</artifactId>
- <version>${maven-resources-plugin.version}</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <version>${maven-jar-plugin.version}</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <version>${maven-source-plugin.version}</version>
- <executions>
- <execution>
- <id>attach-sources</id>
- <phase>verify</phase>
- <goals>
- <goal>jar-no-fork</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.rat</groupId>
- <artifactId>apache-rat-plugin</artifactId>
- <version>${apache-rat-plugin.version}</version>
- <configuration>
- <excludes>
- <exclude>**/target/**</exclude>
- <exclude>**/logs/**</exclude>
- <exclude>**/*.log</exclude>
- <!-- IDE files -->
- <exclude>**/*.iml</exclude>
- <exclude>**/.idea/**</exclude>
- <exclude>**/*.classpath</exclude>
- <exclude>**/.project</exclude>
- <exclude>**/.settings/**</exclude>
- <exclude>**/dependency-reduced-pom.xml</exclude>
- <!-- git files -->
- <exclude>**/.gitignore</exclude>
- <exclude>**/.gitmodules</exclude>
- <exclude>**/.git/**</exclude>
- <!-- CI files -->
- <exclude>**/.travis.yml</exclude>
- <exclude>**/.mvn/jvm.config</exclude>
- <exclude>**/.mvn/wrapper/maven-wrapper.properties</exclude>
- <!-- GitHub files -->
- <exclude>**/.github/**</exclude>
- <!-- document files -->
- <exclude>**/*.md</exclude>
- <excldue>**/*.MD</excldue>
- <exclude>**/*.txt</exclude>
- <exclude>**/docs/**</exclude>
- </excludes>
- </configuration>
- <executions>
- <execution>
- <phase>verify</phase>
- <goals>
- <goal>check</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/pom.xml b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/pom.xml
deleted file mode 100644
index 2e369b7..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/pom.xml
+++ /dev/null
@@ -1,51 +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>cluster-mode-example</artifactId>
- <version>5.0.0-RC1-SNAPSHOT</version>
- </parent>
- <artifactId>cluster-mode-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.example</groupId>
- <artifactId>config-utility</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-jdbc-core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-cluster-mode-repository-zookeeper-curator</artifactId>
- </dependency>
- </dependencies>
-</project>
diff --git a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/cluster/mode/raw/jdbc/ClusterModeRawJavaConfigurationExample.java b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/cluster/mode/raw/jdbc/ClusterModeRawJavaConfigurationExample.java
deleted file mode 100644
index 4bb947f..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/cluster/mode/raw/jdbc/ClusterModeRawJavaConfigurationExample.java
+++ /dev/null
@@ -1,99 +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.cluster.mode.raw.jdbc;
-
-import org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource;
-import org.apache.shardingsphere.example.cluster.mode.raw.jdbc.config.ClusterModeConfigurationUtil;
-import org.apache.shardingsphere.example.cluster.mode.raw.jdbc.config.cloud.CloudEncryptConfiguration;
-import org.apache.shardingsphere.example.cluster.mode.raw.jdbc.config.cloud.CloudReadwriteSplittingConfiguration;
-import org.apache.shardingsphere.example.cluster.mode.raw.jdbc.config.cloud.CloudShadowConfiguration;
-import org.apache.shardingsphere.example.cluster.mode.raw.jdbc.config.cloud.CloudShardingDatabasesAndTablesConfiguration;
-import org.apache.shardingsphere.example.cluster.mode.raw.jdbc.config.local.LocalEncryptConfiguration;
-import org.apache.shardingsphere.example.cluster.mode.raw.jdbc.config.local.LocalReadwriteSplittingConfiguration;
-import org.apache.shardingsphere.example.cluster.mode.raw.jdbc.config.local.LocalShadowConfiguration;
-import org.apache.shardingsphere.example.cluster.mode.raw.jdbc.config.local.LocalShardingDatabasesAndTablesConfiguration;
-import org.apache.shardingsphere.example.config.ExampleConfiguration;
-import org.apache.shardingsphere.example.core.api.ExampleExecuteTemplate;
-import org.apache.shardingsphere.example.core.api.service.ExampleService;
-import org.apache.shardingsphere.example.core.jdbc.service.OrderServiceImpl;
-import org.apache.shardingsphere.example.type.ShardingType;
-import org.apache.shardingsphere.infra.config.mode.ModeConfiguration;
-
-import javax.sql.DataSource;
-import java.sql.SQLException;
-
-/*
- * 1. Please make sure primary replica data replication sync on MySQL is running correctly. Otherwise this example will query empty data from replica.
- * 2. Please make sure sharding-governance-center-zookeeper-curator in your pom if registryCenterType = RegistryCenterType.ZOOKEEPER.
- */
-public final class ClusterModeRawJavaConfigurationExample {
-
- private static ShardingType shardingType = ShardingType.SHARDING_DATABASES_AND_TABLES;
-// private static ShardingType shardingType = ShardingType.READWRITE_SPLITTING;
-// private static ShardingType shardingType = ShardingType.ENCRYPT;
-// private static ShardingType shardingType = ShardingType.SHADOW;
-
- private static boolean loadConfigFromRegCenter = false;
-// private static boolean loadConfigFromRegCenter = true;
-
- public static void main(final String[] args) throws Exception {
- DataSource dataSource = getDataSource(shardingType, loadConfigFromRegCenter);
- try {
- ExampleExecuteTemplate.run(getExampleService(dataSource));
- } finally {
- closeDataSource(dataSource);
- }
- }
-
- private static DataSource getDataSource(final ShardingType shardingType, final boolean loadConfigFromRegCenter) throws SQLException {
- ModeConfiguration modeConfig = getModeConfiguration(shardingType);
- ExampleConfiguration config;
- switch (shardingType) {
- case SHARDING_DATABASES_AND_TABLES:
- config = loadConfigFromRegCenter
- ? new CloudShardingDatabasesAndTablesConfiguration(modeConfig) : new LocalShardingDatabasesAndTablesConfiguration(modeConfig);
- break;
- case READWRITE_SPLITTING:
- config = loadConfigFromRegCenter ? new CloudReadwriteSplittingConfiguration(modeConfig) : new LocalReadwriteSplittingConfiguration(modeConfig);
- break;
- case ENCRYPT:
- config = loadConfigFromRegCenter ? new CloudEncryptConfiguration(modeConfig) : new LocalEncryptConfiguration(modeConfig);
- break;
- case SHADOW:
- config = loadConfigFromRegCenter ? new CloudShadowConfiguration(modeConfig) : new LocalShadowConfiguration(modeConfig);
- break;
- default:
- throw new UnsupportedOperationException(shardingType.name());
- }
- return config.getDataSource();
- }
-
- private static ModeConfiguration getModeConfiguration(final ShardingType shardingType) {
- return ClusterModeConfigurationUtil.getZooKeeperConfiguration(!loadConfigFromRegCenter, shardingType);
- }
-
- private static ExampleService getExampleService(final DataSource dataSource) {
- return new OrderServiceImpl(dataSource);
- }
-
- private static void closeDataSource(final DataSource dataSource) throws Exception {
- if (dataSource instanceof ShardingSphereDataSource) {
- ((ShardingSphereDataSource) dataSource).close();
- }
- }
-}
diff --git a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/cluster/mode/raw/jdbc/ClusterModeRawYamlConfigurationExample.java b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/cluster/mode/raw/jdbc/ClusterModeRawYamlConfigurationExample.java
deleted file mode 100644
index 138fb36..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/cluster/mode/raw/jdbc/ClusterModeRawYamlConfigurationExample.java
+++ /dev/null
@@ -1,92 +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.cluster.mode.raw.jdbc;
-
-import org.apache.shardingsphere.driver.api.yaml.YamlShardingSphereDataSourceFactory;
-import org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource;
-import org.apache.shardingsphere.example.core.api.ExampleExecuteTemplate;
-import org.apache.shardingsphere.example.core.api.service.ExampleService;
-import org.apache.shardingsphere.example.core.jdbc.service.OrderServiceImpl;
-import org.apache.shardingsphere.example.type.RegistryCenterType;
-import org.apache.shardingsphere.example.type.ShardingType;
-
-import javax.sql.DataSource;
-import java.io.File;
-import java.io.IOException;
-import java.sql.SQLException;
-
-/*
- * 1. Please make sure primary replica data replication sync on MySQL is running correctly. Otherwise this example will query empty data from replica.
- * 2. Please make sure sharding-governance-center-zookeeper-curator in your pom if registryCenterType = RegistryCenterType.ZOOKEEPER.
- * 3. Please make sure sharding-governance-center-nacos in your pom if registryCenterType = RegistryCenterType.NACOS.
- */
-public final class ClusterModeRawYamlConfigurationExample {
-
- private static ShardingType shardingType = ShardingType.SHARDING_DATABASES_AND_TABLES;
-// private static ShardingType shardingType = ShardingType.READWRITE_SPLITTING;
-// private static ShardingType shardingType = ShardingType.ENCRYPT;
-// private static ShardingType shardingType = ShardingType.SHADOW;
-
- private static boolean loadConfigFromRegCenter = false;
-// private static boolean loadConfigFromRegCenter = true;
-
- private static RegistryCenterType registryCenterType = RegistryCenterType.ZOOKEEPER;
-
- public static void main(final String[] args) throws Exception {
- DataSource dataSource = getDataSource(registryCenterType, loadConfigFromRegCenter, shardingType);
- try {
- ExampleExecuteTemplate.run(getExampleService(dataSource));
- } finally {
- closeDataSource(dataSource);
- }
- }
-
- private static DataSource getDataSource(final RegistryCenterType registryCenterType, final boolean loadConfigFromRegCenter, final ShardingType shardingType) throws SQLException, IOException {
- String yamlFilePath;
- switch (shardingType) {
- case SHARDING_DATABASES_AND_TABLES:
- yamlFilePath = String.format("/META-INF/%s/%s/sharding-databases-tables.yaml", registryCenterType.name().toLowerCase(), loadConfigFromRegCenter ? "cloud" : "local");
- return YamlShardingSphereDataSourceFactory.createDataSource(getFile(yamlFilePath));
- case READWRITE_SPLITTING:
- yamlFilePath = String.format("/META-INF/%s/%s/readwrite-splitting.yaml", registryCenterType.name().toLowerCase(), loadConfigFromRegCenter ? "cloud" : "local");
- return YamlShardingSphereDataSourceFactory.createDataSource(getFile(yamlFilePath));
- case ENCRYPT:
- yamlFilePath = String.format("/META-INF/%s/%s/encrypt.yaml", registryCenterType.name().toLowerCase(), loadConfigFromRegCenter ? "cloud" : "local");
- return YamlShardingSphereDataSourceFactory.createDataSource(getFile(yamlFilePath));
- case SHADOW:
- yamlFilePath = String.format("/META-INF/%s/%s/shadow.yaml", registryCenterType.name().toLowerCase(), loadConfigFromRegCenter ? "cloud" : "local");
- return YamlShardingSphereDataSourceFactory.createDataSource(getFile(yamlFilePath));
- default:
- throw new UnsupportedOperationException(shardingType.name());
- }
- }
-
- private static File getFile(final String fileName) {
- return new File(ClusterModeRawYamlConfigurationExample.class.getResource(fileName).getFile());
- }
-
- private static ExampleService getExampleService(final DataSource dataSource) {
- return new OrderServiceImpl(dataSource);
- }
-
- private static void closeDataSource(final DataSource dataSource) throws Exception {
- if (dataSource instanceof ShardingSphereDataSource) {
- ((ShardingSphereDataSource) dataSource).close();
- }
- }
-}
diff --git a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/cluster/mode/raw/jdbc/config/ClusterModeConfigurationUtil.java b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/cluster/mode/raw/jdbc/config/ClusterModeConfigurationUtil.java
deleted file mode 100644
index 129b011..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/cluster/mode/raw/jdbc/config/ClusterModeConfigurationUtil.java
+++ /dev/null
@@ -1,49 +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.cluster.mode.raw.jdbc.config;
-
-import org.apache.shardingsphere.example.type.ShardingType;
-import org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepositoryConfiguration;
-import org.apache.shardingsphere.infra.config.mode.ModeConfiguration;
-
-import java.util.Properties;
-
-public final class ClusterModeConfigurationUtil {
-
- private static final String ZOOKEEPER_CONNECTION_STRING = "localhost:2181";
-
- public static ModeConfiguration getZooKeeperConfiguration(final boolean overwrite, final ShardingType shardingType) {
- ClusterPersistRepositoryConfiguration clusterRepositoryConfig;
- switch (shardingType) {
- case SHARDING_DATABASES_AND_TABLES:
- clusterRepositoryConfig = new ClusterPersistRepositoryConfiguration("ZooKeeper", "governance-sharding-data-source", ZOOKEEPER_CONNECTION_STRING, new Properties());
- return new ModeConfiguration("Cluster", clusterRepositoryConfig, overwrite);
- case READWRITE_SPLITTING:
- clusterRepositoryConfig = new ClusterPersistRepositoryConfiguration("ZooKeeper", "governance-readwrite-splitting-data-source", ZOOKEEPER_CONNECTION_STRING, new Properties());
- return new ModeConfiguration("Cluster", clusterRepositoryConfig, overwrite);
- case ENCRYPT:
- clusterRepositoryConfig = new ClusterPersistRepositoryConfiguration("ZooKeeper", "governance-encrypt-data-source", ZOOKEEPER_CONNECTION_STRING, new Properties());
- return new ModeConfiguration("Cluster", clusterRepositoryConfig, overwrite);
- case SHADOW:
- clusterRepositoryConfig = new ClusterPersistRepositoryConfiguration("ZooKeeper", "governance-shadow-data-source", ZOOKEEPER_CONNECTION_STRING, new Properties());
- return new ModeConfiguration("Cluster", clusterRepositoryConfig, overwrite);
- default:
- throw new UnsupportedOperationException(shardingType.toString());
- }
- }
-}
diff --git a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/cluster/mode/raw/jdbc/config/cloud/CloudEncryptConfiguration.java b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/cluster/mode/raw/jdbc/config/cloud/CloudEncryptConfiguration.java
deleted file mode 100644
index 7780448..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/cluster/mode/raw/jdbc/config/cloud/CloudEncryptConfiguration.java
+++ /dev/null
@@ -1,39 +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.cluster.mode.raw.jdbc.config.cloud;
-
-import org.apache.shardingsphere.driver.api.ShardingSphereDataSourceFactory;
-import org.apache.shardingsphere.example.config.ExampleConfiguration;
-import org.apache.shardingsphere.infra.config.mode.ModeConfiguration;
-
-import javax.sql.DataSource;
-import java.sql.SQLException;
-
-public class CloudEncryptConfiguration implements ExampleConfiguration {
-
- private final ModeConfiguration modeConfig;
-
- public CloudEncryptConfiguration(final ModeConfiguration modeConfig) {
- this.modeConfig = modeConfig;
- }
-
- @Override
- public DataSource getDataSource() throws SQLException {
- return ShardingSphereDataSourceFactory.createDataSource(modeConfig);
- }
-}
diff --git a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/cluster/mode/raw/jdbc/config/cloud/CloudReadwriteSplittingConfiguration.java b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/cluster/mode/raw/jdbc/config/cloud/CloudReadwriteSplittingConfiguration.java
deleted file mode 100644
index e4a3c95..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/cluster/mode/raw/jdbc/config/cloud/CloudReadwriteSplittingConfiguration.java
+++ /dev/null
@@ -1,39 +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.cluster.mode.raw.jdbc.config.cloud;
-
-import org.apache.shardingsphere.driver.api.ShardingSphereDataSourceFactory;
-import org.apache.shardingsphere.example.config.ExampleConfiguration;
-import org.apache.shardingsphere.infra.config.mode.ModeConfiguration;
-
-import javax.sql.DataSource;
-import java.sql.SQLException;
-
-public final class CloudReadwriteSplittingConfiguration implements ExampleConfiguration {
-
- private final ModeConfiguration modeConfig;
-
- public CloudReadwriteSplittingConfiguration(final ModeConfiguration modeConfig) {
- this.modeConfig = modeConfig;
- }
-
- @Override
- public DataSource getDataSource() throws SQLException {
- return ShardingSphereDataSourceFactory.createDataSource(modeConfig);
- }
-}
diff --git a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/cluster/mode/raw/jdbc/config/cloud/CloudShadowConfiguration.java b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/cluster/mode/raw/jdbc/config/cloud/CloudShadowConfiguration.java
deleted file mode 100644
index 9a5def1..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/cluster/mode/raw/jdbc/config/cloud/CloudShadowConfiguration.java
+++ /dev/null
@@ -1,39 +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.cluster.mode.raw.jdbc.config.cloud;
-
-import org.apache.shardingsphere.driver.api.ShardingSphereDataSourceFactory;
-import org.apache.shardingsphere.example.config.ExampleConfiguration;
-import org.apache.shardingsphere.infra.config.mode.ModeConfiguration;
-
-import javax.sql.DataSource;
-import java.sql.SQLException;
-
-public final class CloudShadowConfiguration implements ExampleConfiguration {
-
- private final ModeConfiguration modeConfig;
-
- public CloudShadowConfiguration(final ModeConfiguration modeConfig) {
- this.modeConfig = modeConfig;
- }
-
- @Override
- public DataSource getDataSource() throws SQLException {
- return ShardingSphereDataSourceFactory.createDataSource(modeConfig);
- }
-}
diff --git a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/cluster/mode/raw/jdbc/config/cloud/CloudShardingDatabasesAndTablesConfiguration.java b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/cluster/mode/raw/jdbc/config/cloud/CloudShardingDatabasesAndTablesConfiguration.java
deleted file mode 100644
index bb6cb5d..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/cluster/mode/raw/jdbc/config/cloud/CloudShardingDatabasesAndTablesConfiguration.java
+++ /dev/null
@@ -1,39 +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.cluster.mode.raw.jdbc.config.cloud;
-
-import org.apache.shardingsphere.driver.api.ShardingSphereDataSourceFactory;
-import org.apache.shardingsphere.example.config.ExampleConfiguration;
-import org.apache.shardingsphere.infra.config.mode.ModeConfiguration;
-
-import javax.sql.DataSource;
-import java.sql.SQLException;
-
-public final class CloudShardingDatabasesAndTablesConfiguration implements ExampleConfiguration {
-
- private final ModeConfiguration modeConfig;
-
- public CloudShardingDatabasesAndTablesConfiguration(final ModeConfiguration modeConfig) {
- this.modeConfig = modeConfig;
- }
-
- @Override
- public DataSource getDataSource() throws SQLException {
- return ShardingSphereDataSourceFactory.createDataSource(modeConfig);
- }
-}
diff --git a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/cluster/mode/raw/jdbc/config/local/LocalEncryptConfiguration.java b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/cluster/mode/raw/jdbc/config/local/LocalEncryptConfiguration.java
deleted file mode 100644
index 80164e4..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/cluster/mode/raw/jdbc/config/local/LocalEncryptConfiguration.java
+++ /dev/null
@@ -1,62 +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.cluster.mode.raw.jdbc.config.local;
-
-import com.google.common.collect.ImmutableMap;
-import org.apache.shardingsphere.driver.api.ShardingSphereDataSourceFactory;
-import org.apache.shardingsphere.encrypt.api.config.EncryptRuleConfiguration;
-import org.apache.shardingsphere.encrypt.api.config.rule.EncryptColumnRuleConfiguration;
-import org.apache.shardingsphere.encrypt.api.config.rule.EncryptTableRuleConfiguration;
-import org.apache.shardingsphere.example.config.ExampleConfiguration;
-import org.apache.shardingsphere.example.core.api.DataSourceUtil;
-import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
-import org.apache.shardingsphere.infra.config.mode.ModeConfiguration;
-
-import javax.sql.DataSource;
-import java.sql.SQLException;
-import java.util.Collections;
-import java.util.Properties;
-
-public final class LocalEncryptConfiguration implements ExampleConfiguration {
-
- private final ModeConfiguration modeConfig;
-
- public LocalEncryptConfiguration(final ModeConfiguration modeConfig) {
- this.modeConfig = modeConfig;
- }
-
- @Override
- public DataSource getDataSource() throws SQLException {
- return ShardingSphereDataSourceFactory.createDataSource(modeConfig, DataSourceUtil.createDataSource("demo_ds"), Collections.singleton(getEncryptRuleConfiguration()), new Properties());
- }
-
- private EncryptRuleConfiguration getEncryptRuleConfiguration() {
- return new EncryptRuleConfiguration(Collections.singleton(createEncryptTableRuleConfiguration()), ImmutableMap.of("status_encryptor", createEncryptAlgorithmConfiguration()));
- }
-
- private EncryptTableRuleConfiguration createEncryptTableRuleConfiguration() {
- EncryptColumnRuleConfiguration encryptColumnRuleConfig = new EncryptColumnRuleConfiguration("status", "status", "", "", "status_encryptor");
- return new EncryptTableRuleConfiguration("t_order", Collections.singleton(encryptColumnRuleConfig));
- }
-
- private ShardingSphereAlgorithmConfiguration createEncryptAlgorithmConfiguration() {
- Properties props = new Properties();
- props.setProperty("aes-key-value", "123456");
- return new ShardingSphereAlgorithmConfiguration("AES", props);
- }
-}
diff --git a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/cluster/mode/raw/jdbc/config/local/LocalReadwriteSplittingConfiguration.java b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/cluster/mode/raw/jdbc/config/local/LocalReadwriteSplittingConfiguration.java
deleted file mode 100644
index 67e0dc9..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/cluster/mode/raw/jdbc/config/local/LocalReadwriteSplittingConfiguration.java
+++ /dev/null
@@ -1,58 +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.cluster.mode.raw.jdbc.config.local;
-
-import org.apache.shardingsphere.driver.api.ShardingSphereDataSourceFactory;
-import org.apache.shardingsphere.example.config.ExampleConfiguration;
-import org.apache.shardingsphere.example.core.api.DataSourceUtil;
-import org.apache.shardingsphere.infra.config.mode.ModeConfiguration;
-import org.apache.shardingsphere.readwritesplitting.api.ReadwriteSplittingRuleConfiguration;
-import org.apache.shardingsphere.readwritesplitting.api.rule.ReadwriteSplittingDataSourceRuleConfiguration;
-
-import javax.sql.DataSource;
-import java.sql.SQLException;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-
-public final class LocalReadwriteSplittingConfiguration implements ExampleConfiguration {
-
- private final ModeConfiguration modeConfig;
-
- public LocalReadwriteSplittingConfiguration(final ModeConfiguration modeConfig) {
- this.modeConfig = modeConfig;
- }
-
- @Override
- public DataSource getDataSource() throws SQLException {
- ReadwriteSplittingDataSourceRuleConfiguration dataSourceConfig = new ReadwriteSplittingDataSourceRuleConfiguration(
- "demo_readwrite_splitting_ds", "", "demo_write_ds", Arrays.asList("demo_read_ds_0", "demo_read_ds_1"), null, false);
- ReadwriteSplittingRuleConfiguration ruleConfig = new ReadwriteSplittingRuleConfiguration(Collections.singleton(dataSourceConfig), Collections.emptyMap());
- return ShardingSphereDataSourceFactory.createDataSource(modeConfig, createDataSourceMap(), Collections.singleton(ruleConfig), new Properties());
- }
-
- private Map<String, DataSource> createDataSourceMap() {
- Map<String, DataSource> result = new HashMap<>(3, 1);
- result.put("demo_write_ds", DataSourceUtil.createDataSource("demo_write_ds"));
- result.put("demo_read_ds_0", DataSourceUtil.createDataSource("demo_read_ds_0"));
- result.put("demo_read_ds_1", DataSourceUtil.createDataSource("demo_read_ds_1"));
- return result;
- }
-}
diff --git a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/cluster/mode/raw/jdbc/config/local/LocalShadowConfiguration.java b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/cluster/mode/raw/jdbc/config/local/LocalShadowConfiguration.java
deleted file mode 100644
index e98c748..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/cluster/mode/raw/jdbc/config/local/LocalShadowConfiguration.java
+++ /dev/null
@@ -1,56 +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.cluster.mode.raw.jdbc.config.local;
-
-import org.apache.shardingsphere.driver.api.ShardingSphereDataSourceFactory;
-import org.apache.shardingsphere.example.config.ExampleConfiguration;
-import org.apache.shardingsphere.example.core.api.DataSourceUtil;
-import org.apache.shardingsphere.infra.config.mode.ModeConfiguration;
-import org.apache.shardingsphere.shadow.api.config.ShadowRuleConfiguration;
-
-import javax.sql.DataSource;
-import java.sql.SQLException;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-
-public final class LocalShadowConfiguration implements ExampleConfiguration {
-
- private final ModeConfiguration modeConfig;
-
- public LocalShadowConfiguration(final ModeConfiguration modeConfig) {
- this.modeConfig = modeConfig;
- }
-
- @Override
- public DataSource getDataSource() throws SQLException {
- return ShardingSphereDataSourceFactory.createDataSource(modeConfig, createDataSourceMap(), Collections.singleton(getShadowRuleConfiguration()), new Properties());
- }
-
- private Map<String, DataSource> createDataSourceMap() {
- Map<String, DataSource> result = new HashMap<>(2, 1);
- result.put("ds", DataSourceUtil.createDataSource("demo_ds"));
- result.put("shadow_ds", DataSourceUtil.createDataSource("shadow_demo_ds"));
- return result;
- }
-
- private ShadowRuleConfiguration getShadowRuleConfiguration() {
- return new ShadowRuleConfiguration("shadow", Collections.singletonList("ds"), Collections.singletonList("shadow_ds"));
- }
-}
diff --git a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/cluster/mode/raw/jdbc/config/local/LocalShardingDatabasesAndTablesConfiguration.java b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/cluster/mode/raw/jdbc/config/local/LocalShardingDatabasesAndTablesConfiguration.java
deleted file mode 100644
index 4fe61ba..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/cluster/mode/raw/jdbc/config/local/LocalShardingDatabasesAndTablesConfiguration.java
+++ /dev/null
@@ -1,92 +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.cluster.mode.raw.jdbc.config.local;
-
-import org.apache.shardingsphere.driver.api.ShardingSphereDataSourceFactory;
-import org.apache.shardingsphere.example.config.ExampleConfiguration;
-import org.apache.shardingsphere.example.core.api.DataSourceUtil;
-import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
-import org.apache.shardingsphere.infra.config.mode.ModeConfiguration;
-import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
-import org.apache.shardingsphere.sharding.api.config.rule.ShardingTableRuleConfiguration;
-import org.apache.shardingsphere.sharding.api.config.strategy.keygen.KeyGenerateStrategyConfiguration;
-import org.apache.shardingsphere.sharding.api.config.strategy.sharding.StandardShardingStrategyConfiguration;
-
-import javax.sql.DataSource;
-import java.sql.SQLException;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-
-public final class LocalShardingDatabasesAndTablesConfiguration implements ExampleConfiguration {
-
- private final ModeConfiguration modeConfig;
-
- public LocalShardingDatabasesAndTablesConfiguration(final ModeConfiguration modeConfig) {
- this.modeConfig = modeConfig;
- }
-
- private static KeyGenerateStrategyConfiguration getKeyGeneratorConfiguration() {
- return new KeyGenerateStrategyConfiguration("order_id", "snowflake");
- }
-
- @Override
- public DataSource getDataSource() throws SQLException {
- return ShardingSphereDataSourceFactory.createDataSource(modeConfig, createDataSourceMap(), Collections.singleton(createShardingRuleConfiguration()), new Properties());
- }
-
- private ShardingRuleConfiguration createShardingRuleConfiguration() {
- ShardingRuleConfiguration result = new ShardingRuleConfiguration();
- result.getTables().add(getOrderTableRuleConfiguration());
- result.getTables().add(getOrderItemTableRuleConfiguration());
- result.getBindingTableGroups().add("t_order, t_order_item");
- result.getBroadcastTables().add("t_address");
- result.setDefaultDatabaseShardingStrategy(new StandardShardingStrategyConfiguration("user_id", "inline"));
- result.setDefaultTableShardingStrategy(new StandardShardingStrategyConfiguration("order_id", "standard_test_tbl"));
- Properties props = new Properties();
- props.setProperty("algorithm-expression", "demo_ds_${user_id % 2}");
- result.getShardingAlgorithms() .put("inline", new ShardingSphereAlgorithmConfiguration("INLINE", props));
- result.getShardingAlgorithms() .put("standard_test_tbl", new ShardingSphereAlgorithmConfiguration("STANDARD_TEST_TBL", new Properties()));
- result.getKeyGenerators().put("snowflake", new ShardingSphereAlgorithmConfiguration("SNOWFLAKE", getProperties()));
- return result;
- }
-
- private ShardingTableRuleConfiguration getOrderTableRuleConfiguration() {
- ShardingTableRuleConfiguration result = new ShardingTableRuleConfiguration("t_order", "demo_ds_${0..1}.t_order_${[0, 1]}");
- result.setKeyGenerateStrategy(getKeyGeneratorConfiguration());
- return result;
- }
-
- private ShardingTableRuleConfiguration getOrderItemTableRuleConfiguration() {
- return new ShardingTableRuleConfiguration("t_order_item", "demo_ds_${0..1}.t_order_item_${[0, 1]}");
- }
-
- private Map<String, DataSource> createDataSourceMap() {
- Map<String, DataSource> result = new HashMap<>();
- result.put("demo_ds_0", DataSourceUtil.createDataSource("demo_ds_0"));
- result.put("demo_ds_1", DataSourceUtil.createDataSource("demo_ds_1"));
- return result;
- }
-
- private static Properties getProperties() {
- Properties result = new Properties();
- result.setProperty("worker-id", "123");
- return result;
- }
-}
diff --git a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/cluster/mode/raw/jdbc/config/local/LocalShardingDatabasesConfiguration.java b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/cluster/mode/raw/jdbc/config/local/LocalShardingDatabasesConfiguration.java
deleted file mode 100644
index de8dfea..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/cluster/mode/raw/jdbc/config/local/LocalShardingDatabasesConfiguration.java
+++ /dev/null
@@ -1,90 +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.cluster.mode.raw.jdbc.config.local;
-
-import org.apache.shardingsphere.driver.api.ShardingSphereDataSourceFactory;
-import org.apache.shardingsphere.example.config.ExampleConfiguration;
-import org.apache.shardingsphere.example.core.api.DataSourceUtil;
-import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
-import org.apache.shardingsphere.infra.config.mode.ModeConfiguration;
-import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
-import org.apache.shardingsphere.sharding.api.config.rule.ShardingTableRuleConfiguration;
-import org.apache.shardingsphere.sharding.api.config.strategy.keygen.KeyGenerateStrategyConfiguration;
-import org.apache.shardingsphere.sharding.api.config.strategy.sharding.StandardShardingStrategyConfiguration;
-
-import javax.sql.DataSource;
-import java.sql.SQLException;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-
-public final class LocalShardingDatabasesConfiguration implements ExampleConfiguration {
-
- private final ModeConfiguration modeConfig;
-
- public LocalShardingDatabasesConfiguration(final ModeConfiguration modeConfig) {
- this.modeConfig = modeConfig;
- }
-
- private static KeyGenerateStrategyConfiguration getKeyGeneratorConfiguration() {
- return new KeyGenerateStrategyConfiguration("order_id", "snowflake");
- }
-
- @Override
- public DataSource getDataSource() throws SQLException {
- return ShardingSphereDataSourceFactory.createDataSource(modeConfig, createDataSourceMap(), Collections.singleton(createShardingRuleConfiguration()), new Properties());
- }
-
- private ShardingRuleConfiguration createShardingRuleConfiguration() {
- ShardingRuleConfiguration result = new ShardingRuleConfiguration();
- result.getTables().add(getOrderTableRuleConfiguration());
- result.getTables().add(getOrderItemTableRuleConfiguration());
- result.getBindingTableGroups().add("t_order, t_order_item");
- result.getBroadcastTables().add("t_address");
- result.setDefaultDatabaseShardingStrategy(new StandardShardingStrategyConfiguration("user_id", "inline"));
- Properties props = new Properties();
- props.setProperty("algorithm-expression", "demo_ds_${user_id % 2}");
- result.getShardingAlgorithms() .put("inline", new ShardingSphereAlgorithmConfiguration("INLINE", props));
- result.getKeyGenerators().put("snowflake", new ShardingSphereAlgorithmConfiguration("SNOWFLAKE", getProps()));
- return result;
- }
-
- private ShardingTableRuleConfiguration getOrderTableRuleConfiguration() {
- ShardingTableRuleConfiguration result = new ShardingTableRuleConfiguration("t_order");
- result.setKeyGenerateStrategy(getKeyGeneratorConfiguration());
- return result;
- }
-
- private ShardingTableRuleConfiguration getOrderItemTableRuleConfiguration() {
- return new ShardingTableRuleConfiguration("t_order_item");
- }
-
- private Map<String, DataSource> createDataSourceMap() {
- Map<String, DataSource> result = new HashMap<>();
- result.put("demo_ds_0", DataSourceUtil.createDataSource("demo_ds_0"));
- result.put("demo_ds_1", DataSourceUtil.createDataSource("demo_ds_1"));
- return result;
- }
-
- private static Properties getProps() {
- Properties result = new Properties();
- result.setProperty("worker-id", "123");
- return result;
- }
-}
diff --git a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/cluster/mode/raw/jdbc/config/local/LocalShardingReadwriteSplittingConfiguration.java b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/cluster/mode/raw/jdbc/config/local/LocalShardingReadwriteSplittingConfiguration.java
deleted file mode 100644
index 79187be..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/cluster/mode/raw/jdbc/config/local/LocalShardingReadwriteSplittingConfiguration.java
+++ /dev/null
@@ -1,111 +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.cluster.mode.raw.jdbc.config.local;
-
-import org.apache.shardingsphere.driver.api.ShardingSphereDataSourceFactory;
-import org.apache.shardingsphere.example.config.ExampleConfiguration;
-import org.apache.shardingsphere.example.core.api.DataSourceUtil;
-import org.apache.shardingsphere.infra.config.RuleConfiguration;
-import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
-import org.apache.shardingsphere.infra.config.mode.ModeConfiguration;
-import org.apache.shardingsphere.readwritesplitting.api.ReadwriteSplittingRuleConfiguration;
-import org.apache.shardingsphere.readwritesplitting.api.rule.ReadwriteSplittingDataSourceRuleConfiguration;
-import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
-import org.apache.shardingsphere.sharding.api.config.rule.ShardingTableRuleConfiguration;
-import org.apache.shardingsphere.sharding.api.config.strategy.keygen.KeyGenerateStrategyConfiguration;
-import org.apache.shardingsphere.sharding.api.config.strategy.sharding.StandardShardingStrategyConfiguration;
-
-import javax.sql.DataSource;
-import java.sql.SQLException;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.Map;
-import java.util.Properties;
-
-public final class LocalShardingReadwriteSplittingConfiguration implements ExampleConfiguration {
-
- private final ModeConfiguration modeConfig;
-
- public LocalShardingReadwriteSplittingConfiguration(final ModeConfiguration modeConfig) {
- this.modeConfig = modeConfig;
- }
-
- @Override
- public DataSource getDataSource() throws SQLException {
- Collection<RuleConfiguration> configs = new LinkedList<>();
- configs.add(getShardingRuleConfiguration());
- configs.add(getReadwriteSplittingRuleConfiguration());
- return ShardingSphereDataSourceFactory.createDataSource(modeConfig, createDataSourceMap(), configs, new Properties());
- }
-
- private ShardingRuleConfiguration getShardingRuleConfiguration() {
- ShardingRuleConfiguration result = new ShardingRuleConfiguration();
- result.getTables().add(getOrderTableRuleConfiguration());
- result.getTables().add(getOrderItemTableRuleConfiguration());
- result.getBindingTableGroups().add("t_order, t_order_item");
- result.getBroadcastTables().add("t_address");
- result.setDefaultDatabaseShardingStrategy(new StandardShardingStrategyConfiguration("user_id", "standard_test_db"));
- result.setDefaultTableShardingStrategy(new StandardShardingStrategyConfiguration("order_id", "standard_test_tbl"));
- result.getShardingAlgorithms() .put("standard_test_db", new ShardingSphereAlgorithmConfiguration("STANDARD_TEST_DB", new Properties()));
- result.getShardingAlgorithms() .put("standard_test_tbl", new ShardingSphereAlgorithmConfiguration("STANDARD_TEST_TBL", new Properties()));
- result.getKeyGenerators().put("snowflake", new ShardingSphereAlgorithmConfiguration("SNOWFLAKE", getProperties()));
- return result;
- }
-
- private ShardingTableRuleConfiguration getOrderTableRuleConfiguration() {
- ShardingTableRuleConfiguration result = new ShardingTableRuleConfiguration("t_order", "ds_${0..1}.t_order_${[0, 1]}");
- result.setKeyGenerateStrategy(getKeyGeneratorConfiguration());
- return result;
- }
-
- private ShardingTableRuleConfiguration getOrderItemTableRuleConfiguration() {
- return new ShardingTableRuleConfiguration("t_order_item", "ds_${0..1}.t_order_item_${[0, 1]}");
- }
-
- private static KeyGenerateStrategyConfiguration getKeyGeneratorConfiguration() {
- return new KeyGenerateStrategyConfiguration("order_id", "snowflake");
- }
-
- private ReadwriteSplittingRuleConfiguration getReadwriteSplittingRuleConfiguration() {
- ReadwriteSplittingDataSourceRuleConfiguration dataSourceConfiguration1 = new ReadwriteSplittingDataSourceRuleConfiguration(
- "ds_0", "", "demo_write_ds_0", Arrays.asList("demo_write_ds_0_read_0", "demo_write_ds_0_read_1"), null, false);
- ReadwriteSplittingDataSourceRuleConfiguration dataSourceConfiguration2 = new ReadwriteSplittingDataSourceRuleConfiguration(
- "ds_1", "", "demo_write_ds_1", Arrays.asList("demo_write_ds_1_read_0", "demo_write_ds_1_read_1"), null, false);
- return new ReadwriteSplittingRuleConfiguration(Arrays.asList(dataSourceConfiguration1, dataSourceConfiguration2), Collections.emptyMap());
- }
-
- private static Properties getProperties() {
- Properties result = new Properties();
- result.setProperty("worker-id", "123");
- return result;
- }
-
- private Map<String, DataSource> createDataSourceMap() {
- Map<String, DataSource> result = new HashMap<>(6, 1);
- result.put("demo_write_ds_0", DataSourceUtil.createDataSource("demo_write_ds_0"));
- result.put("demo_write_ds_0_read_0", DataSourceUtil.createDataSource("demo_write_ds_0_read_0"));
- result.put("demo_write_ds_0_read_1", DataSourceUtil.createDataSource("demo_write_ds_0_read_1"));
- result.put("demo_write_ds_1", DataSourceUtil.createDataSource("demo_write_ds_1"));
- result.put("demo_write_ds_1_read_0", DataSourceUtil.createDataSource("demo_write_ds_1_read_0"));
- result.put("demo_write_ds_1_read_1", DataSourceUtil.createDataSource("demo_write_ds_1_read_1"));
- return result;
- }
-}
diff --git a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/cluster/mode/raw/jdbc/config/local/LocalShardingTablesConfiguration.java b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/cluster/mode/raw/jdbc/config/local/LocalShardingTablesConfiguration.java
deleted file mode 100644
index 06e235c..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/cluster/mode/raw/jdbc/config/local/LocalShardingTablesConfiguration.java
+++ /dev/null
@@ -1,87 +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.cluster.mode.raw.jdbc.config.local;
-
-import org.apache.shardingsphere.driver.api.ShardingSphereDataSourceFactory;
-import org.apache.shardingsphere.example.config.ExampleConfiguration;
-import org.apache.shardingsphere.example.core.api.DataSourceUtil;
-import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
-import org.apache.shardingsphere.infra.config.mode.ModeConfiguration;
-import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
-import org.apache.shardingsphere.sharding.api.config.rule.ShardingTableRuleConfiguration;
-import org.apache.shardingsphere.sharding.api.config.strategy.keygen.KeyGenerateStrategyConfiguration;
-import org.apache.shardingsphere.sharding.api.config.strategy.sharding.StandardShardingStrategyConfiguration;
-
-import javax.sql.DataSource;
-import java.sql.SQLException;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-
-public final class LocalShardingTablesConfiguration implements ExampleConfiguration {
-
- private final ModeConfiguration modeConfig;
-
- public LocalShardingTablesConfiguration(final ModeConfiguration modeConfig) {
- this.modeConfig = modeConfig;
- }
-
- @Override
- public DataSource getDataSource() throws SQLException {
- return ShardingSphereDataSourceFactory.createDataSource(modeConfig, createDataSourceMap(), Collections.singleton(createShardingRuleConfiguration()), new Properties());
- }
-
- private ShardingRuleConfiguration createShardingRuleConfiguration() {
- ShardingRuleConfiguration result = new ShardingRuleConfiguration();
- result.getTables().add(getOrderTableRuleConfiguration());
- result.getTables().add(getOrderItemTableRuleConfiguration());
- result.getBindingTableGroups().add("t_order, t_order_item");
- result.getBroadcastTables().add("t_address");
- result.setDefaultTableShardingStrategy(new StandardShardingStrategyConfiguration("order_id", "standard_test_tbl"));
- result.getShardingAlgorithms().put("standard_test_tbl", new ShardingSphereAlgorithmConfiguration("STANDARD_TEST_TBL", new Properties()));
- result.getKeyGenerators().put("snowflake", new ShardingSphereAlgorithmConfiguration("SNOWFLAKE", getProperties()));
- return result;
- }
-
- private ShardingTableRuleConfiguration getOrderTableRuleConfiguration() {
- ShardingTableRuleConfiguration result = new ShardingTableRuleConfiguration("t_order", "demo_ds.t_order_${[0, 1]}");
- result.setKeyGenerateStrategy(getKeyGeneratorConfiguration());
- return result;
- }
-
- private ShardingTableRuleConfiguration getOrderItemTableRuleConfiguration() {
- return new ShardingTableRuleConfiguration("t_order_item", "demo_ds.t_order_item_${[0, 1]}");
- }
-
- private Map<String, DataSource> createDataSourceMap() {
- Map<String, DataSource> result = new HashMap<>();
- result.put("demo_ds", DataSourceUtil.createDataSource("demo_ds"));
- return result;
- }
-
- private static KeyGenerateStrategyConfiguration getKeyGeneratorConfiguration() {
- return new KeyGenerateStrategyConfiguration("order_id", "snowflake");
- }
-
- private static Properties getProperties() {
- Properties result = new Properties();
- result.setProperty("worker-id", "123");
- return result;
- }
-}
diff --git a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/resources/META-INF/zookeeper/cloud/encrypt.yaml b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/resources/META-INF/zookeeper/cloud/encrypt.yaml
deleted file mode 100644
index 7947d19..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/resources/META-INF/zookeeper/cloud/encrypt.yaml
+++ /dev/null
@@ -1,25 +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.
-#
-
-mode:
- type: Cluster
- repository:
- type: ZooKeeper
- props:
- namespace: demo_yaml_ds_encrypt
- server-lists: localhost:2181
- overwrite: false
diff --git a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/resources/META-INF/zookeeper/cloud/readwrite-splitting.yaml b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/resources/META-INF/zookeeper/cloud/readwrite-splitting.yaml
deleted file mode 100644
index 602c657..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/resources/META-INF/zookeeper/cloud/readwrite-splitting.yaml
+++ /dev/null
@@ -1,25 +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.
-#
-
-mode:
- type: Cluster
- repository:
- type: ZooKeeper
- props:
- namespace: demo_yaml_pr_ds
- server-lists: localhost:2181
- overwrite: false
diff --git a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/resources/META-INF/zookeeper/cloud/shadow.yaml b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/resources/META-INF/zookeeper/cloud/shadow.yaml
deleted file mode 100644
index 3799fff..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/resources/META-INF/zookeeper/cloud/shadow.yaml
+++ /dev/null
@@ -1,25 +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.
-#
-
-mode:
- type: Cluster
- repository:
- type: ZooKeeper
- props:
- namespace: demo_yaml_ds_shadow
- server-lists: localhost:2181
- overwrite: false
diff --git a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/resources/META-INF/zookeeper/cloud/sharding-databases-tables.yaml b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/resources/META-INF/zookeeper/cloud/sharding-databases-tables.yaml
deleted file mode 100644
index 88f2dfb..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/resources/META-INF/zookeeper/cloud/sharding-databases-tables.yaml
+++ /dev/null
@@ -1,27 +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.
-#
-
-schemaName: sharding-databases-tables
-
-mode:
- type: Cluster
- repository:
- type: ZooKeeper
- props:
- namespace: demo_yaml_ds_sharding
- server-lists: localhost:2181
- overwrite: false
diff --git a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/resources/META-INF/zookeeper/local/encrypt.yaml b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/resources/META-INF/zookeeper/local/encrypt.yaml
deleted file mode 100644
index cde7e09..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/resources/META-INF/zookeeper/local/encrypt.yaml
+++ /dev/null
@@ -1,50 +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.
-#
-
-mode:
- type: Cluster
- repository:
- type: ZooKeeper
- props:
- namespace: demo_yaml_ds_encrypt
- server-lists: localhost:2181
- overwrite: true
-
-dataSources:
- uinque_ds:
- dataSourceClassName: com.zaxxer.hikari.HikariDataSource
- driverClassName: com.mysql.jdbc.Driver
- jdbcUrl: jdbc:mysql://localhost:3306/demo_ds?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
- username: root
- password:
-
-rules:
-- !ENCRYPT
- tables:
- t_order:
- columns:
- status:
- cipherColumn: status
- encryptorName: status_encryptor
- encryptors:
- status_encryptor:
- type: AES
- props:
- aes-key-value: 123456abc
-
-props:
- sql-show: true
diff --git a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/resources/META-INF/zookeeper/local/readwrite-splitting.yaml b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/resources/META-INF/zookeeper/local/readwrite-splitting.yaml
deleted file mode 100644
index 068c42c..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/resources/META-INF/zookeeper/local/readwrite-splitting.yaml
+++ /dev/null
@@ -1,55 +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.
-#
-
-mode:
- type: Cluster
- repository:
- type: ZooKeeper
- props:
- namespace: demo_yaml_pr_ds
- server-lists: localhost:2181
- overwrite: true
-
-dataSources:
- write_ds:
- dataSourceClassName: com.zaxxer.hikari.HikariDataSource
- driverClassName: com.mysql.jdbc.Driver
- jdbcUrl: jdbc:mysql://localhost:3306/demo_write_ds?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
- username: root
- password:
- read_ds_0:
- dataSourceClassName: com.zaxxer.hikari.HikariDataSource
- driverClassName: com.mysql.jdbc.Driver
- jdbcUrl: jdbc:mysql://localhost:3306/demo_read_ds_0?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
- username: root
- password:
- read_ds_1:
- dataSourceClassName: com.zaxxer.hikari.HikariDataSource
- driverClassName: com.mysql.jdbc.Driver
- jdbcUrl: jdbc:mysql://localhost:3306/demo_read_ds_1?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
- username: root
- password:
-
-rules:
-- !READWRITE_SPLITTING
- dataSources:
- pr_ds:
- writeDataSourceName: write_ds
- readDataSourceNames: [read_ds_0, read_ds_1]
-
-props:
- sql-show: true
diff --git a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/resources/META-INF/zookeeper/local/shadow.yaml b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/resources/META-INF/zookeeper/local/shadow.yaml
deleted file mode 100644
index 58bd579..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/resources/META-INF/zookeeper/local/shadow.yaml
+++ /dev/null
@@ -1,50 +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.
-#
-
-mode:
- type: Cluster
- repository:
- type: ZooKeeper
- props:
- namespace: demo_yaml_ds_shadow
- server-lists: localhost:2181
- overwrite: true
-
-dataSources:
- ds:
- dataSourceClassName: com.zaxxer.hikari.HikariDataSource
- driverClassName: com.mysql.jdbc.Driver
- jdbcUrl: jdbc:mysql://localhost:3306/demo_ds?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
- username: root
- password:
- ds_0:
- dataSourceClassName: com.zaxxer.hikari.HikariDataSource
- driverClassName: com.mysql.jdbc.Driver
- jdbcUrl: jdbc:mysql://localhost:3306/shadow_demo_ds?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
- username: root
- password:
-
-rules:
- - !SHADOW
- column: shadow
- sourceDataSourceNames:
- - ds
- shadowDataSourceNames:
- - ds_0
-
-props:
- sql-show: true
diff --git a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/resources/META-INF/zookeeper/local/sharding-databases-tables.yaml b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/resources/META-INF/zookeeper/local/sharding-databases-tables.yaml
deleted file mode 100644
index 6ab0653..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/resources/META-INF/zookeeper/local/sharding-databases-tables.yaml
+++ /dev/null
@@ -1,94 +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.
-#
-
-schemaName: sharding-databases-tables
-
-mode:
- type: Cluster
- repository:
- type: ZooKeeper
- props:
- namespace: demo_yaml_ds_sharding
- server-lists: localhost:2181
- overwrite: true
-
-dataSources:
- ds_0:
- dataSourceClassName: com.zaxxer.hikari.HikariDataSource
- driverClassName: com.mysql.jdbc.Driver
- jdbcUrl: jdbc:mysql://localhost:3306/demo_ds_0?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
- username: root
- password:
- ds_1:
- dataSourceClassName: com.zaxxer.hikari.HikariDataSource
- driverClassName: com.mysql.jdbc.Driver
- jdbcUrl: jdbc:mysql://localhost:3306/demo_ds_1?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
- username: root
- password:
-
-rules:
-- !SHARDING
- tables:
- t_order:
- actualDataNodes: ds_${0..1}.t_order_${0..1}
- tableStrategy:
- standard:
- shardingColumn: order_id
- shardingAlgorithmName: t_order_inline
- keyGenerateStrategy:
- column: order_id
- keyGeneratorName: snowflake
- t_order_item:
- actualDataNodes: ds_${0..1}.t_order_item_${0..1}
- tableStrategy:
- standard:
- shardingColumn: order_id
- shardingAlgorithmName: t_order_item_inline
- bindingTables:
- - t_order,t_order_item
- broadcastTables:
- - t_address
-
- defaultDatabaseStrategy:
- standard:
- shardingColumn: user_id
- shardingAlgorithmName: database_inline
- defaultTableStrategy:
- none:
-
- shardingAlgorithms:
- database_inline:
- type: INLINE
- props:
- algorithm-expression: ds_${user_id % 2}
- t_order_inline:
- type: INLINE
- props:
- algorithm-expression: t_order_${order_id % 2}
- t_order_item_inline:
- type: INLINE
- props:
- algorithm-expression: t_order_item_${order_id % 2}
-
- keyGenerators:
- snowflake:
- type: SNOWFLAKE
- props:
- worker-id: 123
-
-props:
- sql-show: true
diff --git a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/resources/logback.xml b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-raw-jdbc-example/src/main/resources/logback.xml
deleted file mode 100644
index c3a1e6c..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-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="cluster-mode-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/cluster-mode-example/cluster-mode-spring-boot-mybatis-example/pom.xml b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-boot-mybatis-example/pom.xml
deleted file mode 100644
index a99deb3..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-boot-mybatis-example/pom.xml
+++ /dev/null
@@ -1,50 +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>cluster-mode-example</artifactId>
- <version>5.0.0-RC1-SNAPSHOT</version>
- </parent>
- <artifactId>cluster-mode-spring-boot-mybatis-example</artifactId>
- <name>${project.artifactId}</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.shardingsphere.example</groupId>
- <artifactId>example-spring-mybatis</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-jdbc-core-spring-boot-starter</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-cluster-mode-repository-zookeeper-curator</artifactId>
- </dependency>
- <dependency>
- <groupId>org.mybatis.spring.boot</groupId>
- <artifactId>mybatis-spring-boot-starter</artifactId>
- </dependency>
- </dependencies>
-</project>
diff --git a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-boot-mybatis-example/src/main/java/org/apache/shardingsphere/example/cluster/mode/spring/boot/mybatis/ClusterModeSpringBootMybatisExample.java b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-boot-mybatis-example/src/main/java/org/apache/shardingsphere/example/cluster/mode/spring/boot/mybatis/ClusterModeSpringBootMybatisExample.java
deleted file mode 100644
index 3f37761..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-boot-mybatis-example/src/main/java/org/apache/shardingsphere/example/cluster/mode/spring/boot/mybatis/ClusterModeSpringBootMybatisExample.java
+++ /dev/null
@@ -1,41 +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.cluster.mode.spring.boot.mybatis;
-
-import org.apache.shardingsphere.example.core.api.ExampleExecuteTemplate;
-import org.apache.shardingsphere.example.core.api.service.ExampleService;
-import org.mybatis.spring.annotation.MapperScan;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.autoconfigure.transaction.jta.JtaAutoConfiguration;
-import org.springframework.context.ConfigurableApplicationContext;
-import org.springframework.context.annotation.ComponentScan;
-
-import java.sql.SQLException;
-
-@ComponentScan("org.apache.shardingsphere.example.core.mybatis")
-@MapperScan(basePackages = "org.apache.shardingsphere.example.core.mybatis.repository")
-@SpringBootApplication(exclude = JtaAutoConfiguration.class)
-public class ClusterModeSpringBootMybatisExample {
-
- public static void main(final String[] args) throws SQLException {
- try (ConfigurableApplicationContext applicationContext = SpringApplication.run(ClusterModeSpringBootMybatisExample.class, args)) {
- ExampleExecuteTemplate.run(applicationContext.getBean(ExampleService.class));
- }
- }
-}
diff --git a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-boot-mybatis-example/src/main/resources/META-INF/mybatis-config.xml b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-boot-mybatis-example/src/main/resources/META-INF/mybatis-config.xml
deleted file mode 100644
index fa18441..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-boot-mybatis-example/src/main/resources/META-INF/mybatis-config.xml
+++ /dev/null
@@ -1,30 +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.
- -->
-
-<!DOCTYPE configuration
- PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-config.dtd">
-<configuration>
- <mappers>
- <mapper resource="META-INF/mappers/AddressMapper.xml"/>
- <mapper resource="META-INF/mappers/OrderMapper.xml"/>
- <mapper resource="META-INF/mappers/OrderItemMapper.xml"/>
- <mapper resource="META-INF/mappers/UserMapper.xml"/>
- <mapper resource="META-INF/mappers/ShadowUserMapper.xml"/>
- </mappers>
-</configuration>
diff --git a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-boot-mybatis-example/src/main/resources/application-cloud-zookeeper-encrypt.properties b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-boot-mybatis-example/src/main/resources/application-cloud-zookeeper-encrypt.properties
deleted file mode 100644
index ef7d346..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-boot-mybatis-example/src/main/resources/application-cloud-zookeeper-encrypt.properties
+++ /dev/null
@@ -1,22 +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.
-#
-
-spring.shardingsphere.mode.type=Cluster
-spring.shardingsphere.mode.repository.type=ZooKeeper
-spring.shardingsphere.mode.repository.props.namespace=demo_spring_boot_ds_encrypt
-spring.shardingsphere.mode.repository.props.server-lists=localhost:2181
-spring.shardingsphere.mode.overwrite=false
diff --git a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-boot-mybatis-example/src/main/resources/application-cloud-zookeeper-readwrite-splitting.properties b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-boot-mybatis-example/src/main/resources/application-cloud-zookeeper-readwrite-splitting.properties
deleted file mode 100644
index d917d2d..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-boot-mybatis-example/src/main/resources/application-cloud-zookeeper-readwrite-splitting.properties
+++ /dev/null
@@ -1,22 +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.
-#
-
-spring.shardingsphere.mode.type=Cluster
-spring.shardingsphere.mode.repository.type=ZooKeeper
-spring.shardingsphere.mode.repository.props.namespace=demo_spring_boot_pr_ds
-spring.shardingsphere.mode.repository.props.server-lists=localhost:2181
-spring.shardingsphere.mode.overwrite=false
diff --git a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-boot-mybatis-example/src/main/resources/application-cloud-zookeeper-shadow.properties b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-boot-mybatis-example/src/main/resources/application-cloud-zookeeper-shadow.properties
deleted file mode 100644
index 5135ae0..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-boot-mybatis-example/src/main/resources/application-cloud-zookeeper-shadow.properties
+++ /dev/null
@@ -1,22 +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.
-#
-
-spring.shardingsphere.mode.type=Cluster
-spring.shardingsphere.mode.repository.type=ZooKeeper
-spring.shardingsphere.mode.repository.props.namespace=demo_spring_boot_ds_shadow
-spring.shardingsphere.mode.repository.props.server-lists=localhost:2181
-spring.shardingsphere.mode.overwrite=false
diff --git a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-boot-mybatis-example/src/main/resources/application-cloud-zookeeper-sharding-databases-tables.properties b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-boot-mybatis-example/src/main/resources/application-cloud-zookeeper-sharding-databases-tables.properties
deleted file mode 100644
index 608bf27..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-boot-mybatis-example/src/main/resources/application-cloud-zookeeper-sharding-databases-tables.properties
+++ /dev/null
@@ -1,24 +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.
-#
-
-spring.shardingsphere.schema.name=sharding-databases-tables
-
-spring.shardingsphere.mode.type=Cluster
-spring.shardingsphere.mode.repository.type=ZooKeeper
-spring.shardingsphere.mode.repository.props.namespace=demo_spring_boot_ds_sharding
-spring.shardingsphere.mode.repository.props.server-lists=localhost:2181
-spring.shardingsphere.mode.overwrite=false
diff --git a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-boot-mybatis-example/src/main/resources/application-local-zookeeper-encrypt.properties b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-boot-mybatis-example/src/main/resources/application-local-zookeeper-encrypt.properties
deleted file mode 100644
index 106ebde..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-boot-mybatis-example/src/main/resources/application-local-zookeeper-encrypt.properties
+++ /dev/null
@@ -1,38 +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.
-#
-
-spring.shardingsphere.mode.type=Cluster
-spring.shardingsphere.mode.repository.type=ZooKeeper
-spring.shardingsphere.mode.repository.props.namespace=demo_spring_boot_ds_encrypt
-spring.shardingsphere.mode.repository.props.server-lists=localhost:2181
-spring.shardingsphere.mode.overwrite=true
-
-spring.shardingsphere.datasource.name=ds-encrypt
-
-spring.shardingsphere.datasource.ds-encrypt.type=com.zaxxer.hikari.HikariDataSource
-spring.shardingsphere.datasource.ds-encrypt.driver-class-name=com.mysql.jdbc.Driver
-spring.shardingsphere.datasource.ds-encrypt.jdbc-url=jdbc:mysql://localhost:3306/demo_ds?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
-spring.shardingsphere.datasource.ds-encrypt.username=root
-spring.shardingsphere.datasource.ds-encrypt.password=
-
-spring.shardingsphere.rules.encrypt.encryptors.status-encryptor.type=AES
-spring.shardingsphere.rules.encrypt.encryptors.status-encryptor.props.aes-key-value=123456
-spring.shardingsphere.rules.encrypt.tables.t_order.columns.status.cipher-column=status
-spring.shardingsphere.rules.encrypt.tables.t_order.columns.status.encryptor-name=status-encryptor
-
-spring.shardingsphere.props.query.with.cipher.comlum=true
-spring.shardingsphere.props.sql-show=true
diff --git a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-boot-mybatis-example/src/main/resources/application-local-zookeeper-readwrite-splitting.properties b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-boot-mybatis-example/src/main/resources/application-local-zookeeper-readwrite-splitting.properties
deleted file mode 100644
index c6787f5..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-boot-mybatis-example/src/main/resources/application-local-zookeeper-readwrite-splitting.properties
+++ /dev/null
@@ -1,47 +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.
-#
-
-spring.shardingsphere.mode.type=Cluster
-spring.shardingsphere.mode.repository.type=ZooKeeper
-spring.shardingsphere.mode.repository.props.namespace=demo_spring_boot_pr_ds
-spring.shardingsphere.mode.repository.props.server-lists=localhost:2181
-spring.shardingsphere.mode.overwrite=true
-
-spring.shardingsphere.datasource.names=write-ds,read-ds-0,read-ds-1
-
-spring.shardingsphere.datasource.write-ds.jdbc-url=jdbc:mysql://localhost:3306/demo_write_ds?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
-spring.shardingsphere.datasource.write-ds.type=com.zaxxer.hikari.HikariDataSource
-spring.shardingsphere.datasource.write-ds.driver-class-name=com.mysql.jdbc.Driver
-spring.shardingsphere.datasource.write-ds.username=root
-spring.shardingsphere.datasource.write-ds.password=
-
-spring.shardingsphere.datasource.read-ds-0.jdbc-url=jdbc:mysql://localhost:3306/demo_read_ds_0?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
-spring.shardingsphere.datasource.read-ds-0.type=com.zaxxer.hikari.HikariDataSource
-spring.shardingsphere.datasource.read-ds-0.driver-class-name=com.mysql.jdbc.Driver
-spring.shardingsphere.datasource.read-ds-0.username=root
-spring.shardingsphere.datasource.read-ds-0.password=
-
-spring.shardingsphere.datasource.read-ds-1.jdbc-url=jdbc:mysql://localhost:3306/demo_read_ds_1?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
-spring.shardingsphere.datasource.read-ds-1.type=com.zaxxer.hikari.HikariDataSource
-spring.shardingsphere.datasource.read-ds-1.driver-class-name=com.mysql.jdbc.Driver
-spring.shardingsphere.datasource.read-ds-1.username=root
-spring.shardingsphere.datasource.read-ds-1.password=
-
-spring.shardingsphere.rules.readwrite-splitting.load-balancers.round_robin.type=ROUND_ROBIN
-spring.shardingsphere.rules.readwrite-splitting.data-sources.pr_ds.write-data-source-name=write-ds
-spring.shardingsphere.rules.readwrite-splitting.data-sources.pr_ds.read-data-source-names=read-ds-0,read-ds-1
-spring.shardingsphere.rules.readwrite-splitting.data-sources.pr_ds.load-balancer-name=round_robin
diff --git a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-boot-mybatis-example/src/main/resources/application-local-zookeeper-shadow.properties b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-boot-mybatis-example/src/main/resources/application-local-zookeeper-shadow.properties
deleted file mode 100644
index 5e20db2..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-boot-mybatis-example/src/main/resources/application-local-zookeeper-shadow.properties
+++ /dev/null
@@ -1,42 +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.
-#
-
-spring.shardingsphere.mode.type=Cluster
-spring.shardingsphere.mode.repository.type=ZooKeeper
-spring.shardingsphere.mode.repository.props.namespace=demo_spring_boot_ds_shadow
-spring.shardingsphere.mode.repository.props.server-lists=localhost:2181
-spring.shardingsphere.mode.overwrite=true
-
-spring.shardingsphere.datasource.name=ds,shadow-ds
-
-spring.shardingsphere.datasource.shadow-ds.jdbc-url=jdbc:mysql://localhost:3306/shadow_demo_ds?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
-spring.shardingsphere.datasource.shadow-ds.type=com.zaxxer.hikari.HikariDataSource
-spring.shardingsphere.datasource.shadow-ds.driver-class-name=com.mysql.jdbc.Driver
-spring.shardingsphere.datasource.shadow-ds.username=root
-spring.shardingsphere.datasource.shadow-ds.password=
-
-spring.shardingsphere.datasource.ds.jdbc-url=jdbc:mysql://localhost:3306/demo_ds?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
-spring.shardingsphere.datasource.ds.type=com.zaxxer.hikari.HikariDataSource
-spring.shardingsphere.datasource.ds.driver-class-name=com.mysql.jdbc.Driver
-spring.shardingsphere.datasource.ds.username=root
-spring.shardingsphere.datasource.ds.password=
-
-spring.shardingsphere.rules.shadow.column=shadow
-spring.shardingsphere.rules.shadow.source-data-source-names=ds
-spring.shardingsphere.rules.shadow.shadow-data-source-names=shadow-ds
-
-spring.shardingsphere.props.sql-show=true
diff --git a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-boot-mybatis-example/src/main/resources/application-local-zookeeper-sharding-databases-tables.properties b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-boot-mybatis-example/src/main/resources/application-local-zookeeper-sharding-databases-tables.properties
deleted file mode 100644
index b5d15e4..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-boot-mybatis-example/src/main/resources/application-local-zookeeper-sharding-databases-tables.properties
+++ /dev/null
@@ -1,75 +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.
-#
-
-spring.shardingsphere.schema.name=sharding-databases-tables
-
-spring.shardingsphere.mode.type=Cluster
-spring.shardingsphere.mode.repository.type=ZooKeeper
-spring.shardingsphere.mode.repository.props.namespace=demo_spring_boot_ds_sharding
-spring.shardingsphere.mode.repository.props.server-lists=localhost:2181
-spring.shardingsphere.mode.overwrite=true
-
-spring.shardingsphere.datasource.names=ds-0,ds-1
-
-spring.shardingsphere.datasource.ds-0.type=com.zaxxer.hikari.HikariDataSource
-spring.shardingsphere.datasource.ds-0.driver-class-name=com.mysql.jdbc.Driver
-spring.shardingsphere.datasource.ds-0.jdbc-url=jdbc:mysql://localhost:3306/demo_ds_0?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
-spring.shardingsphere.datasource.ds-0.username=root
-spring.shardingsphere.datasource.ds-0.password=
-spring.shardingsphere.datasource.ds-0.max-active=16
-
-spring.shardingsphere.datasource.ds-1.type=com.zaxxer.hikari.HikariDataSource
-spring.shardingsphere.datasource.ds-1.driver-class-name=com.mysql.jdbc.Driver
-spring.shardingsphere.datasource.ds-1.jdbc-url=jdbc:mysql://localhost:3306/demo_ds_1?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
-spring.shardingsphere.datasource.ds-1.username=root
-spring.shardingsphere.datasource.ds-1.password=
-spring.shardingsphere.datasource.ds-1.max-active=16
-
-spring.shardingsphere.rules.sharding.default-database-strategy.standard.sharding-column=user_id
-spring.shardingsphere.rules.sharding.default-database-strategy.standard.sharding-algorithm-name=database-inline
-
-spring.shardingsphere.rules.sharding.binding-tables=t_order,t_order_item
-spring.shardingsphere.rules.sharding.broadcast-tables=t_address
-
-spring.shardingsphere.rules.sharding.tables.t_order.actual-data-nodes=ds-$->{0..1}.t_order_$->{0..1}
-spring.shardingsphere.rules.sharding.tables.t_order.table-strategy.standard.sharding-column=order_id
-spring.shardingsphere.rules.sharding.tables.t_order.table-strategy.standard.sharding-algorithm-name=t-order-inline
-
-spring.shardingsphere.rules.sharding.tables.t_order.key-generate-strategy.column=order_id
-spring.shardingsphere.rules.sharding.tables.t_order.key-generate-strategy.key-generator-name=snowflake
-
-spring.shardingsphere.rules.sharding.tables.t_order_item.actual-data-nodes=ds-$->{0..1}.t_order_item_$->{0..1}
-spring.shardingsphere.rules.sharding.tables.t_order_item.table-strategy.standard.sharding-column=order_id
-spring.shardingsphere.rules.sharding.tables.t_order_item.table-strategy.standard.sharding-algorithm-name=t-order-item-inline
-
-spring.shardingsphere.rules.sharding.tables.t_order_item.key-generate-strategy.column=order_item_id
-spring.shardingsphere.rules.sharding.tables.t_order_item.key-generate-strategy.key-generator-name=snowflake
-
-spring.shardingsphere.rules.sharding.sharding-algorithms.database-inline.type=INLINE
-spring.shardingsphere.rules.sharding.sharding-algorithms.database-inline.props.algorithm-expression=ds-$->{user_id % 2}
-spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-inline.type=INLINE
-spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-inline.props.algorithm-expression=t_order_$->{order_id % 2}
-spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-item-inline.type=INLINE
-spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-item-inline.props.algorithm-expression=t_order_item_$->{order_id % 2}
-
-spring.shardingsphere.rules.sharding.key-generators.snowflake.type=SNOWFLAKE
-spring.shardingsphere.rules.sharding.key-generators.snowflake.props.worker-id=123
-
-spring.shardingsphere.rules.encrypt.encryptors.status-encryptor.type=AES
-spring.shardingsphere.rules.encrypt.encryptors.status-encryptor.props.aes-key-value=123456
-spring.shardingsphere.rules.encrypt.tables.t_order.columns.status.cipher-column=status
-spring.shardingsphere.rules.encrypt.tables.t_order.columns.status.encryptor-name=status-encryptor
diff --git a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-boot-mybatis-example/src/main/resources/application.properties b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-boot-mybatis-example/src/main/resources/application.properties
deleted file mode 100644
index 7895ab4..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-boot-mybatis-example/src/main/resources/application.properties
+++ /dev/null
@@ -1,30 +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.
-#
-
-mybatis.config-location=classpath:META-INF/mybatis-config.xml
-
-spring.profiles.active=local-zookeeper-sharding-databases-tables
-#spring.profiles.active=local-zookeeper-readwrite-splitting
-
-#spring.profiles.active=cloud-zookeeper-sharding-databases-tables
-#spring.profiles.active=cloud-zookeeper-readwrite-splitting
-
-#spring.profiles.active=local-zookeeper-encrypt
-#spring.profiles.active=cloud-zookeeper-encrypt
-
-#spring.profiles.active=local-zookeeper-shadow
-#spring.profiles.active=cloud-zookeeper-shadow
diff --git a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-boot-mybatis-example/src/main/resources/logback.xml b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-boot-mybatis-example/src/main/resources/logback.xml
deleted file mode 100644
index 1aec2e0..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-boot-mybatis-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="cluster-mode-spring-boot-mybatis-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/cluster-mode-example/cluster-mode-spring-namespace-mybatis-example/pom.xml b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-namespace-mybatis-example/pom.xml
deleted file mode 100644
index 96f97b9..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-namespace-mybatis-example/pom.xml
+++ /dev/null
@@ -1,51 +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>cluster-mode-example</artifactId>
- <version>5.0.0-RC1-SNAPSHOT</version>
- </parent>
- <artifactId>cluster-mode-spring-namespace-mybatis-example</artifactId>
- <name>${project.artifactId}</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.shardingsphere.example</groupId>
- <artifactId>config-utility</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.shardingsphere.example</groupId>
- <artifactId>example-spring-mybatis</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-jdbc-core-spring-namespace</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-cluster-mode-repository-zookeeper-curator</artifactId>
- </dependency>
- </dependencies>
-</project>
diff --git a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-namespace-mybatis-example/src/main/java/org/apache/shardingsphere/example/cluster/mode/spring/namespace/mybatis/ClusterModeSpringNamespaceMybatisExample.java b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-namespace-mybatis-example/src/main/java/org/apache/shardingsphere/example/cluster/mode/spring/namespace/mybatis/ClusterModeSpringNamespaceMybatisExample.java
deleted file mode 100644
index a4f1832..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-namespace-mybatis-example/src/main/java/org/apache/shardingsphere/example/cluster/mode/spring/namespace/mybatis/ClusterModeSpringNamespaceMybatisExample.java
+++ /dev/null
@@ -1,61 +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.cluster.mode.spring.namespace.mybatis;
-
-import org.apache.shardingsphere.example.core.api.ExampleExecuteTemplate;
-import org.apache.shardingsphere.example.core.api.service.ExampleService;
-import org.apache.shardingsphere.example.type.RegistryCenterType;
-import org.apache.shardingsphere.example.type.ShardingType;
-import org.springframework.context.ConfigurableApplicationContext;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
-
-import java.sql.SQLException;
-
-public final class ClusterModeSpringNamespaceMybatisExample {
-
- private static ShardingType shardingType = ShardingType.SHARDING_DATABASES_AND_TABLES;
-// private static ShardingType shardingType = ShardingType.SHARDING_READWRITE_SPLITTING;
-// private static ShardingType shardingType = ShardingType.ENCRYPT;
-// private static ShardingType shardingType = ShardingType.SHADOW;
-
- private static boolean loadConfigFromRegCenter = false;
-// private static boolean loadConfigFromRegCenter = true;
-
- private static RegistryCenterType registryCenterType = RegistryCenterType.ZOOKEEPER;
-
- public static void main(final String[] args) throws SQLException {
- try (ConfigurableApplicationContext applicationContext = new ClassPathXmlApplicationContext(getApplicationFile())) {
- ExampleExecuteTemplate.run(applicationContext.getBean(ExampleService.class));
- }
- }
-
- private static String getApplicationFile() {
- switch (shardingType) {
- case SHARDING_DATABASES_AND_TABLES:
- return String.format("META-INF/%s/%s/application-sharding-databases-tables.xml", registryCenterType.name().toLowerCase(), loadConfigFromRegCenter ? "cloud" : "local");
- case SHARDING_READWRITE_SPLITTING:
- return String.format("META-INF/%s/%s/application-readwrite-splitting.xml", registryCenterType.name().toLowerCase(), loadConfigFromRegCenter ? "cloud" : "local");
- case ENCRYPT:
- return String.format("META-INF/%s/%s/application-encrypt.xml", registryCenterType.name().toLowerCase(), loadConfigFromRegCenter ? "cloud" : "local");
- case SHADOW:
- return String.format("META-INF/%s/%s/application-shadow.xml", registryCenterType.name().toLowerCase(), loadConfigFromRegCenter ? "cloud" : "local");
- default:
- throw new UnsupportedOperationException(shardingType.name());
- }
- }
-}
diff --git a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-namespace-mybatis-example/src/main/resources/META-INF/zookeeper/cloud/application-encrypt.xml b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-namespace-mybatis-example/src/main/resources/META-INF/zookeeper/cloud/application-encrypt.xml
deleted file mode 100644
index 9d439f0..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-namespace-mybatis-example/src/main/resources/META-INF/zookeeper/cloud/application-encrypt.xml
+++ /dev/null
@@ -1,52 +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.
- -->
-
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:tx="http://www.springframework.org/schema/tx"
- xmlns:shardingsphere="http://shardingsphere.apache.org/schema/shardingsphere/datasource"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/context
- http://www.springframework.org/schema/context/spring-context.xsd
- http://www.springframework.org/schema/tx
- http://www.springframework.org/schema/tx/spring-tx.xsd http://shardingsphere.apache.org/schema/shardingsphere/datasource http://shardingsphere.apache.org/schema/shardingsphere/datasource/datasource.xsd">
- <import resource="classpath*:META-INF/zookeeper/registry-center.xml" />
-
- <context:component-scan base-package="org.apache.shardingsphere.example.core.mybatis" />
-
- <shardingsphere:data-source id="encryptDataSource">
- <shardingsphere:mode type="Cluster" repository-ref="clusterRepository" />
- </shardingsphere:data-source>
-
- <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
- <property name="dataSource" ref="encryptDataSource" />
- </bean>
- <tx:annotation-driven />
-
- <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
- <property name="dataSource" ref="encryptDataSource"/>
- <property name="mapperLocations" value="classpath*:META-INF/mappers/*.xml"/>
- </bean>
-
- <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
- <property name="basePackage" value="org.apache.shardingsphere.example.core.mybatis.repository"/>
- <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/>
- </bean>
-</beans>
diff --git a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-namespace-mybatis-example/src/main/resources/META-INF/zookeeper/cloud/application-readwrite-splitting.xml b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-namespace-mybatis-example/src/main/resources/META-INF/zookeeper/cloud/application-readwrite-splitting.xml
deleted file mode 100644
index 817ae59..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-namespace-mybatis-example/src/main/resources/META-INF/zookeeper/cloud/application-readwrite-splitting.xml
+++ /dev/null
@@ -1,52 +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.
- -->
-
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:tx="http://www.springframework.org/schema/tx"
- xmlns:shardingsphere="http://shardingsphere.apache.org/schema/shardingsphere/datasource"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/context
- http://www.springframework.org/schema/context/spring-context.xsd
- http://www.springframework.org/schema/tx
- http://www.springframework.org/schema/tx/spring-tx.xsd
- http://shardingsphere.apache.org/schema/shardingsphere/datasource http://shardingsphere.apache.org/schema/shardingsphere/datasource/datasource.xsd">
- <context:component-scan base-package="org.apache.shardingsphere.example.core.mybatis" />
- <import resource="classpath*:META-INF/zookeeper/registry-center.xml" />
-
- <shardingsphere:data-source id="readWriteSplittingDataSource">
- <shardingsphere:mode type="Cluster" repository-ref="clusterRepository" />
- </shardingsphere:data-source>
-
- <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
- <property name="dataSource" ref="readWriteSplittingDataSource" />
- </bean>
- <tx:annotation-driven />
-
- <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
- <property name="dataSource" ref="readWriteSplittingDataSource" />
- <property name="mapperLocations" value="classpath*:META-INF/mappers/*.xml" />
- </bean>
-
- <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
- <property name="basePackage" value="org.apache.shardingsphere.example.core.mybatis.repository" />
- <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" />
- </bean>
-</beans>
diff --git a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-namespace-mybatis-example/src/main/resources/META-INF/zookeeper/cloud/application-shadow.xml b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-namespace-mybatis-example/src/main/resources/META-INF/zookeeper/cloud/application-shadow.xml
deleted file mode 100644
index f31ab7c..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-namespace-mybatis-example/src/main/resources/META-INF/zookeeper/cloud/application-shadow.xml
+++ /dev/null
@@ -1,53 +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.
- -->
-
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:tx="http://www.springframework.org/schema/tx"
- xmlns:shardingsphere="http://shardingsphere.apache.org/schema/shardingsphere/datasource"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/context
- http://www.springframework.org/schema/context/spring-context.xsd
- http://www.springframework.org/schema/tx
- http://www.springframework.org/schema/tx/spring-tx.xsd
- http://shardingsphere.apache.org/schema/shardingsphere/datasource http://shardingsphere.apache.org/schema/shardingsphere/datasource/datasource.xsd">
- <import resource="classpath*:META-INF/zookeeper/registry-center.xml" />
-
- <context:component-scan base-package="org.apache.shardingsphere.example.core.mybatis" />
-
- <shardingsphere:data-source id="shadowDataSource">
- <shardingsphere:mode type="Cluster" repository-ref="clusterRepository" />
- </shardingsphere:data-source>
-
- <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
- <property name="dataSource" ref="shadowDataSource" />
- </bean>
- <tx:annotation-driven />
-
- <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
- <property name="dataSource" ref="shadowDataSource"/>
- <property name="mapperLocations" value="classpath*:META-INF/mappers/*.xml"/>
- </bean>
-
- <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
- <property name="basePackage" value="org.apache.shardingsphere.example.core.mybatis.repository"/>
- <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/>
- </bean>
-</beans>
diff --git a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-namespace-mybatis-example/src/main/resources/META-INF/zookeeper/cloud/application-sharding-databases-tables.xml b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-namespace-mybatis-example/src/main/resources/META-INF/zookeeper/cloud/application-sharding-databases-tables.xml
deleted file mode 100644
index 9eee594..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-namespace-mybatis-example/src/main/resources/META-INF/zookeeper/cloud/application-sharding-databases-tables.xml
+++ /dev/null
@@ -1,52 +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.
- -->
-
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:tx="http://www.springframework.org/schema/tx"
- xmlns:shardingsphere="http://shardingsphere.apache.org/schema/shardingsphere/datasource"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/context
- http://www.springframework.org/schema/context/spring-context.xsd
- http://www.springframework.org/schema/tx
- http://www.springframework.org/schema/tx/spring-tx.xsd
- http://shardingsphere.apache.org/schema/shardingsphere/datasource http://shardingsphere.apache.org/schema/shardingsphere/datasource/datasource.xsd">
- <import resource="classpath*:META-INF/zookeeper/registry-center.xml" />
- <context:component-scan base-package="org.apache.shardingsphere.example.core.mybatis" />
-
- <shardingsphere:data-source id="shardingDatabasesTablesDataSource" schema-name="sharding-databases-tables">
- <shardingsphere:mode type="Cluster" repository-ref="clusterRepository" />
- </shardingsphere:data-source>
-
- <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
- <property name="dataSource" ref="shardingDatabasesTablesDataSource" />
- </bean>
- <tx:annotation-driven />
-
- <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
- <property name="dataSource" ref="shardingDatabasesTablesDataSource"/>
- <property name="mapperLocations" value="classpath*:META-INF/mappers/*.xml"/>
- </bean>
-
- <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
- <property name="basePackage" value="org.apache.shardingsphere.example.core.mybatis.repository"/>
- <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/>
- </bean>
-</beans>
diff --git a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-namespace-mybatis-example/src/main/resources/META-INF/zookeeper/local/application-encrypt.xml b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-namespace-mybatis-example/src/main/resources/META-INF/zookeeper/local/application-encrypt.xml
deleted file mode 100644
index 2972775..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-namespace-mybatis-example/src/main/resources/META-INF/zookeeper/local/application-encrypt.xml
+++ /dev/null
@@ -1,79 +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.
- -->
-
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:tx="http://www.springframework.org/schema/tx"
- xmlns:encrypt="http://shardingsphere.apache.org/schema/shardingsphere/encrypt"
- xmlns:shardingsphere="http://shardingsphere.apache.org/schema/shardingsphere/datasource"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/context
- http://www.springframework.org/schema/context/spring-context.xsd
- http://www.springframework.org/schema/tx
- http://www.springframework.org/schema/tx/spring-tx.xsd
- http://shardingsphere.apache.org/schema/shardingsphere/encrypt
- http://shardingsphere.apache.org/schema/shardingsphere/encrypt/encrypt.xsd
- http://shardingsphere.apache.org/schema/shardingsphere/datasource http://shardingsphere.apache.org/schema/shardingsphere/datasource/datasource.xsd">
- <import resource="classpath*:META-INF/zookeeper/registry-center.xml" />
- <context:component-scan base-package="org.apache.shardingsphere.example.core.mybatis" />
-
- <bean id="demo_ds" class="com.zaxxer.hikari.HikariDataSource" destroy-method="close">
- <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
- <property name="jdbcUrl" value="jdbc:mysql://localhost:3306/demo_ds?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8"/>
- <property name="username" value="root"/>
- <property name="password" value=""/>
- </bean>
-
- <encrypt:encrypt-algorithm id="name_encryptor" type="AES">
- <props>
- <prop key="aes-key-value">123456</prop>
- </props>
- </encrypt:encrypt-algorithm>
- <encrypt:encrypt-algorithm id="pwd_encryptor" type="assistedTest" />
-
- <encrypt:rule id="encryptRule">
- <encrypt:table name="t_user">
- <encrypt:column logic-column="user_name" cipher-column="user_name" encrypt-algorithm-ref="name_encryptor" />
- <encrypt:column logic-column="pwd" cipher-column="pwd" assisted-query-column="assisted_query_pwd" encrypt-algorithm-ref="pwd_encryptor" />
- </encrypt:table>
- </encrypt:rule>
-
- <shardingsphere:data-source id="encryptDataSource" data-source-names="demo_ds" rule-refs="encryptRule">
- <shardingsphere:mode type="Cluster" repository-ref="clusterRepository" />
- <props>
- <prop key="sql-show">true</prop>
- </props>
- </shardingsphere:data-source>
-
- <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
- <property name="dataSource" ref="encryptDataSource" />
- </bean>
- <tx:annotation-driven />
-
- <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
- <property name="dataSource" ref="encryptDataSource"/>
- <property name="mapperLocations" value="classpath*:META-INF/mappers/*.xml"/>
- </bean>
-
- <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
- <property name="basePackage" value="org.apache.shardingsphere.example.core.mybatis.repository"/>
- <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/>
- </bean>
-</beans>
diff --git a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-namespace-mybatis-example/src/main/resources/META-INF/zookeeper/local/application-readwrite-splitting.xml b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-namespace-mybatis-example/src/main/resources/META-INF/zookeeper/local/application-readwrite-splitting.xml
deleted file mode 100644
index 9ad109b..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-namespace-mybatis-example/src/main/resources/META-INF/zookeeper/local/application-readwrite-splitting.xml
+++ /dev/null
@@ -1,85 +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.
- -->
-
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:tx="http://www.springframework.org/schema/tx"
- xmlns:readwrite-splitting="http://shardingsphere.apache.org/schema/shardingsphere/readwrite-splitting"
- xmlns:shardingsphere="http://shardingsphere.apache.org/schema/shardingsphere/datasource"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/context
- http://www.springframework.org/schema/context/spring-context.xsd
- http://www.springframework.org/schema/tx
- http://www.springframework.org/schema/tx/spring-tx.xsd
- http://shardingsphere.apache.org/schema/shardingsphere/readwrite-splitting
- http://shardingsphere.apache.org/schema/shardingsphere/readwrite-splitting/readwrite-splitting.xsd
- http://shardingsphere.apache.org/schema/shardingsphere/datasource http://shardingsphere.apache.org/schema/shardingsphere/datasource/datasource.xsd">
- <import resource="classpath*:META-INF/zookeeper/registry-center.xml"/>
- <context:component-scan base-package="org.apache.shardingsphere.example.core.mybatis"/>
-
- <bean id="demo_write_ds" class="com.zaxxer.hikari.HikariDataSource" destroy-method="close">
- <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
- <property name="jdbcUrl" value="jdbc:mysql://localhost:3306/demo_write_ds?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8"/>
- <property name="username" value="root"/>
- <property name="password" value=""/>
- </bean>
-
- <bean id="demo_read_ds_0" class="com.zaxxer.hikari.HikariDataSource" destroy-method="close">
- <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
- <property name="jdbcUrl" value="jdbc:mysql://localhost:3306/demo_read_ds_0?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8"/>
- <property name="username" value="root"/>
- <property name="password" value=""/>
- </bean>
-
- <bean id="demo_read_ds_1" class="com.zaxxer.hikari.HikariDataSource" destroy-method="close">
- <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
- <property name="jdbcUrl" value="jdbc:mysql://localhost:3306/demo_read_ds_1?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8"/>
- <property name="username" value="root"/>
- <property name="password" value=""/>
- </bean>
-
- <readwrite-splitting:load-balance-algorithm id="randomStrategy" type="RANDOM" />
-
- <readwrite-splitting:rule id="readWriteSplittingRule">
- <readwrite-splitting:data-source-rule id="demo_ds" write-data-source-name="demo_write_ds" read-data-source-names="demo_read_ds_0, demo_read_ds_1" load-balance-algorithm-ref="randomStrategy" />
- </readwrite-splitting:rule>
-
- <shardingsphere:data-source id="readWriteSplittingDataSource" data-source-names="demo_write_ds, demo_read_ds_0, demo_read_ds_1" rule-refs="readWriteSplittingRule">
- <shardingsphere:mode type="Cluster" repository-ref="clusterRepository" />
- <props>
- <prop key="sql-show">true</prop>
- </props>
- </shardingsphere:data-source>
-
- <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
- <property name="dataSource" ref="readWriteSplittingDataSource" />
- </bean>
- <tx:annotation-driven />
-
- <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
- <property name="dataSource" ref="readWriteSplittingDataSource" />
- <property name="mapperLocations" value="classpath*:META-INF/mappers/*.xml" />
- </bean>
-
- <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
- <property name="basePackage" value="org.apache.shardingsphere.example.core.mybatis.repository" />
- <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" />
- </bean>
-</beans>
diff --git a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-namespace-mybatis-example/src/main/resources/META-INF/zookeeper/local/application-shadow.xml b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-namespace-mybatis-example/src/main/resources/META-INF/zookeeper/local/application-shadow.xml
deleted file mode 100644
index 4db47d1..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-namespace-mybatis-example/src/main/resources/META-INF/zookeeper/local/application-shadow.xml
+++ /dev/null
@@ -1,74 +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.
- -->
-
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:tx="http://www.springframework.org/schema/tx"
- xmlns:shadow="http://shardingsphere.apache.org/schema/shardingsphere/shadow"
- xmlns:shardingsphere="http://shardingsphere.apache.org/schema/shardingsphere/datasource"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/context
- http://www.springframework.org/schema/context/spring-context.xsd
- http://www.springframework.org/schema/tx
- http://www.springframework.org/schema/tx/spring-tx.xsd
- http://shardingsphere.apache.org/schema/shardingsphere/shadow
- http://shardingsphere.apache.org/schema/shardingsphere/shadow/shadow.xsd
- http://shardingsphere.apache.org/schema/shardingsphere/datasource http://shardingsphere.apache.org/schema/shardingsphere/datasource/datasource.xsd">
- <import resource="classpath*:META-INF/zookeeper/registry-center.xml" />
- <context:component-scan base-package="org.apache.shardingsphere.example.core.mybatis" />
-
- <bean id="shadow_demo_ds" class="com.zaxxer.hikari.HikariDataSource" destroy-method="close">
- <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
- <property name="jdbcUrl" value="jdbc:mysql://localhost:3306/shadow_demo_ds?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8"/>
- <property name="username" value="root"/>
- <property name="password" value=""/>
- </bean>
-
- <bean id="demo_ds" class="com.zaxxer.hikari.HikariDataSource" destroy-method="close">
- <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
- <property name="jdbcUrl" value="jdbc:mysql://localhost:3306/demo_ds?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8"/>
- <property name="username" value="root"/>
- <property name="password" value=""/>
- </bean>
-
- <shadow:rule id="shadowRule" column="shadow" sourceDataSourceNames="demo_ds" shadowDataSourceNames="shadow_demo_ds"/>
-
- <shardingsphere:data-source id="shadowDataSource" data-source-names="demo_ds,shadow_demo_ds" rule-refs="shadowRule">
- <shardingsphere:mode type="Cluster" repository-ref="clusterRepository" />
- <props>
- <prop key="sql-show">true</prop>
- </props>
- </shardingsphere:data-source>
-
- <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
- <property name="dataSource" ref="shadowDataSource" />
- </bean>
- <tx:annotation-driven />
-
- <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
- <property name="dataSource" ref="shadowDataSource"/>
- <property name="mapperLocations" value="classpath*:META-INF/mappers/*.xml"/>
- </bean>
-
- <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
- <property name="basePackage" value="org.apache.shardingsphere.example.core.mybatis.repository"/>
- <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/>
- </bean>
-</beans>
diff --git a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-namespace-mybatis-example/src/main/resources/META-INF/zookeeper/local/application-sharding-databases-tables.xml b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-namespace-mybatis-example/src/main/resources/META-INF/zookeeper/local/application-sharding-databases-tables.xml
deleted file mode 100644
index 223d2d5..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-namespace-mybatis-example/src/main/resources/META-INF/zookeeper/local/application-sharding-databases-tables.xml
+++ /dev/null
@@ -1,117 +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.
- -->
-
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:tx="http://www.springframework.org/schema/tx"
- xmlns:sharding="http://shardingsphere.apache.org/schema/shardingsphere/sharding"
- xmlns:shardingsphere="http://shardingsphere.apache.org/schema/shardingsphere/datasource"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/tx
- http://www.springframework.org/schema/tx/spring-tx.xsd
- http://www.springframework.org/schema/context
- http://www.springframework.org/schema/context/spring-context.xsd
- http://shardingsphere.apache.org/schema/shardingsphere/sharding
- http://shardingsphere.apache.org/schema/shardingsphere/sharding/sharding.xsd
- http://shardingsphere.apache.org/schema/shardingsphere/datasource http://shardingsphere.apache.org/schema/shardingsphere/datasource/datasource.xsd">
- <import resource="classpath*:META-INF/zookeeper/registry-center.xml" />
- <context:component-scan base-package="org.apache.shardingsphere.example.core.mybatis" />
- <bean id="demo_ds_0" class="com.zaxxer.hikari.HikariDataSource" destroy-method="close">
- <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
- <property name="jdbcUrl" value="jdbc:mysql://localhost:3306/demo_ds_0?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8"/>
- <property name="username" value="root"/>
- <property name="password" value=""/>
- </bean>
-
- <bean id="demo_ds_1" class="com.zaxxer.hikari.HikariDataSource" destroy-method="close">
- <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
- <property name="jdbcUrl" value="jdbc:mysql://localhost:3306/demo_ds_1?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8"/>
- <property name="username" value="root"/>
- <property name="password" value=""/>
- </bean>
-
- <sharding:sharding-algorithm id="databaseInlineStrategyShardingAlgorithm" type="INLINE">
- <props>
- <prop key="algorithm-expression">demo_ds_${user_id % 2}</prop>
- </props>
- </sharding:sharding-algorithm>
-
- <sharding:sharding-algorithm id="orderInlineStrategyShardingAlgorithm" type="INLINE">
- <props>
- <prop key="algorithm-expression">t_order_${order_id % 2}</prop>
- </props>
- </sharding:sharding-algorithm>
-
- <sharding:sharding-algorithm id="orderItemInlineStrategyShardingAlgorithm" type="INLINE">
- <props>
- <prop key="algorithm-expression">t_order_item_${order_id % 2}</prop>
- </props>
- </sharding:sharding-algorithm>
-
- <sharding:standard-strategy id="databaseStrategy" sharding-column="user_id" algorithm-ref="databaseInlineStrategyShardingAlgorithm"/>
-
- <sharding:standard-strategy id="orderTableStrategy" sharding-column="order_id" algorithm-ref="orderInlineStrategyShardingAlgorithm"/>
-
- <sharding:standard-strategy id="orderItemTableStrategy" sharding-column="order_id" algorithm-ref="orderItemInlineStrategyShardingAlgorithm"/>
-
- <sharding:key-generate-algorithm id="snowflakeAlgorithm" type="SNOWFLAKE">
- <props>
- <prop key="worker-id">123</prop>
- </props>
- </sharding:key-generate-algorithm>
-
- <sharding:key-generate-strategy id="orderKeyGenerator" column="order_id" algorithm-ref="snowflakeAlgorithm" />
- <sharding:key-generate-strategy id="itemKeyGenerator" column="order_item_id" algorithm-ref="snowflakeAlgorithm" />
-
- <sharding:rule id="shardingRule">
- <sharding:table-rules>
- <sharding:table-rule logic-table="t_order" actual-data-nodes="demo_ds_${0..1}.t_order_${0..1}" database-strategy-ref="databaseStrategy" table-strategy-ref="orderTableStrategy" key-generate-strategy-ref="orderKeyGenerator" />
- <sharding:table-rule logic-table="t_order_item" actual-data-nodes="demo_ds_${0..1}.t_order_item_${0..1}" database-strategy-ref="databaseStrategy" table-strategy-ref="orderItemTableStrategy" key-generate-strategy-ref="itemKeyGenerator" />
- </sharding:table-rules>
- <sharding:binding-table-rules>
- <sharding:binding-table-rule logic-tables="t_order, t_order_item"/>
- </sharding:binding-table-rules>
- <sharding:broadcast-table-rules>
- <sharding:broadcast-table-rule table="t_address"/>
- </sharding:broadcast-table-rules>
- </sharding:rule>
-
- <shardingsphere:data-source id="shardingDatabasesTablesDataSource" schema-name="sharding-databases-tables" data-source-names="demo_ds_0, demo_ds_1" rule-refs="shardingRule">
- <shardingsphere:mode type="Cluster" repository-ref="clusterRepository" />
- <props>
- <prop key="sql-show">true</prop>
- </props>
- </shardingsphere:data-source>
-
- <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
- <property name="dataSource" ref="shardingDatabasesTablesDataSource" />
- </bean>
- <tx:annotation-driven />
-
- <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
- <property name="dataSource" ref="shardingDatabasesTablesDataSource"/>
- <property name="mapperLocations" value="classpath*:META-INF/mappers/*.xml"/>
- </bean>
-
- <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
- <property name="basePackage" value="org.apache.shardingsphere.example.core.mybatis.repository"/>
- <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/>
- </bean>
-</beans>
diff --git a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-namespace-mybatis-example/src/main/resources/META-INF/zookeeper/registry-center.xml b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-namespace-mybatis-example/src/main/resources/META-INF/zookeeper/registry-center.xml
deleted file mode 100644
index f60147b..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-namespace-mybatis-example/src/main/resources/META-INF/zookeeper/registry-center.xml
+++ /dev/null
@@ -1,31 +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.
- -->
-
-<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="http://www.springframework.org/schema/beans"
- xmlns:cluster="http://shardingsphere.apache.org/schema/shardingsphere/mode-repository/cluster"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd
- http://shardingsphere.apache.org/schema/shardingsphere/mode-repository/cluster http://shardingsphere.apache.org/schema/shardingsphere/mode-repository/cluster/repository.xsd">
- <cluster:repository id="clusterRepository" type="ZooKeeper" namespace="regCenter" server-lists="localhost:2181">
- <props>
- <prop key="max-retries">3</prop>
- <prop key="operation-timeout-milliseconds">3000</prop>
- </props>
- </cluster:repository>
-</beans>
diff --git a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-namespace-mybatis-example/src/main/resources/logback.xml b/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-namespace-mybatis-example/src/main/resources/logback.xml
deleted file mode 100644
index 57694fa..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/cluster-mode-spring-namespace-mybatis-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="cluster-mode-spring-namespace-mybatis-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/cluster-mode-example/pom.xml b/examples/shardingsphere-jdbc-example/cluster-mode-example/pom.xml
deleted file mode 100644
index dff6a19..0000000
--- a/examples/shardingsphere-jdbc-example/cluster-mode-example/pom.xml
+++ /dev/null
@@ -1,37 +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>cluster-mode-example</artifactId>
- <name>${project.artifactId}</name>
- <packaging>pom</packaging>
-
- <modules>
- <module>cluster-mode-raw-jdbc-example</module>
- <module>cluster-mode-spring-boot-mybatis-example</module>
- <module>cluster-mode-spring-namespace-mybatis-example</module>
- </modules>
-</project>
diff --git a/examples/shardingsphere-jdbc-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/pom.xml b/examples/shardingsphere-jdbc-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/pom.xml
deleted file mode 100644
index 1006358..0000000
--- a/examples/shardingsphere-jdbc-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/pom.xml
+++ /dev/null
@@ -1,42 +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>custom-sharding-algortihm-example</artifactId>
- <version>5.0.0-RC1-SNAPSHOT</version>
- </parent>
- <artifactId>class-based-sharding-algorithm-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/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/src/main/java/org/apache/shardingsphere/example/extension/sharding/algortihm/classbased/YamlClassBasedShardingAlgorithmExample.java b/examples/shardingsphere-jdbc-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/src/main/java/org/apache/shardingsphere/example/extension/sharding/algortihm/classbased/Ya [...]
deleted file mode 100644
index cac71e0..0000000
--- a/examples/shardingsphere-jdbc-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/src/main/java/org/apache/shardingsphere/example/extension/sharding/algortihm/classbased/YamlClassBasedShardingAlgorithmExample.java
+++ /dev/null
@@ -1,42 +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.extension.sharding.algortihm.classbased;
-
-import org.apache.shardingsphere.example.core.api.ExampleExecuteTemplate;
-import org.apache.shardingsphere.example.core.api.service.ExampleService;
-import org.apache.shardingsphere.example.core.jdbc.service.OrderServiceImpl;
-import org.apache.shardingsphere.example.extension.sharding.algortihm.classbased.factory.YamlDataSourceFactory;
-import org.apache.shardingsphere.example.type.ShardingType;
-
-import javax.sql.DataSource;
-import java.io.IOException;
-import java.sql.SQLException;
-
-public final class YamlClassBasedShardingAlgorithmExample {
-
- private static ShardingType shardingType = ShardingType.SHARDING_DATABASES;
-
- public static void main(final String[] args) throws SQLException, IOException {
- DataSource dataSource = YamlDataSourceFactory.newInstance(shardingType);
- ExampleExecuteTemplate.run(getExampleService(dataSource));
- }
-
- private static ExampleService getExampleService(final DataSource dataSource) {
- return new OrderServiceImpl(dataSource);
- }
-}
diff --git a/examples/shardingsphere-jdbc-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/src/main/java/org/apache/shardingsphere/example/extension/sharding/algortihm/classbased/factory/YamlDataSourceFactory.java b/examples/shardingsphere-jdbc-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/src/main/java/org/apache/shardingsphere/example/extension/sharding/algortihm/classbased/factory/Yam [...]
deleted file mode 100644
index 0c593cf..0000000
--- a/examples/shardingsphere-jdbc-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/src/main/java/org/apache/shardingsphere/example/extension/sharding/algortihm/classbased/factory/YamlDataSourceFactory.java
+++ /dev/null
@@ -1,42 +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.extension.sharding.algortihm.classbased.factory;
-
-import org.apache.shardingsphere.driver.api.yaml.YamlShardingSphereDataSourceFactory;
-import org.apache.shardingsphere.example.type.ShardingType;
-
-import javax.sql.DataSource;
-import java.io.File;
-import java.io.IOException;
-import java.sql.SQLException;
-
-public final class YamlDataSourceFactory {
-
- public static DataSource newInstance(final ShardingType shardingType) throws SQLException, IOException {
- switch (shardingType) {
- case SHARDING_DATABASES:
- return YamlShardingSphereDataSourceFactory.createDataSource(getFile("/META-INF/sharding-databases.yaml"));
- default:
- throw new UnsupportedOperationException(shardingType.name());
- }
- }
-
- private static File getFile(final String fileName) {
- return new File(YamlDataSourceFactory.class.getResource(fileName).getFile());
- }
-}
diff --git a/examples/shardingsphere-jdbc-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/src/main/java/org/apache/shardingsphere/example/extension/sharding/algortihm/classbased/fixture/ClassBasedStandardShardingAlgorithmFixture.java b/examples/shardingsphere-jdbc-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/src/main/java/org/apache/shardingsphere/example/extension/sharding/algortihm/c [...]
deleted file mode 100644
index 7125216..0000000
--- a/examples/shardingsphere-jdbc-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/src/main/java/org/apache/shardingsphere/example/extension/sharding/algortihm/classbased/fixture/ClassBasedStandardShardingAlgorithmFixture.java
+++ /dev/null
@@ -1,51 +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.extension.sharding.algortihm.classbased.fixture;
-
-import org.apache.shardingsphere.sharding.api.sharding.standard.PreciseShardingValue;
-import org.apache.shardingsphere.sharding.api.sharding.standard.RangeShardingValue;
-import org.apache.shardingsphere.sharding.api.sharding.standard.StandardShardingAlgorithm;
-
-import java.util.Collection;
-
-public final class ClassBasedStandardShardingAlgorithmFixture implements StandardShardingAlgorithm<Integer> {
-
- @Override
- public void init() {
- }
-
- @Override
- public String doSharding(final Collection<String> availableTargetNames, final PreciseShardingValue<Integer> shardingValue) {
- for (String each : availableTargetNames) {
- if (each.endsWith(String.valueOf(shardingValue.getValue() % 2))) {
- return each;
- }
- }
- return null;
- }
-
- @Override
- public Collection<String> doSharding(final Collection<String> availableTargetNames, final RangeShardingValue<Integer> shardingValue) {
- return availableTargetNames;
- }
-
- @Override
- public String getType() {
- return null;
- }
-}
diff --git a/examples/shardingsphere-jdbc-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/src/main/resources/META-INF/sharding-databases.yaml b/examples/shardingsphere-jdbc-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/src/main/resources/META-INF/sharding-databases.yaml
deleted file mode 100644
index 3804eb5..0000000
--- a/examples/shardingsphere-jdbc-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/src/main/resources/META-INF/sharding-databases.yaml
+++ /dev/null
@@ -1,70 +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.
-#
-
-dataSources:
- ds_0:
- dataSourceClassName: com.zaxxer.hikari.HikariDataSource
- driverClassName: com.mysql.jdbc.Driver
- jdbcUrl: jdbc:mysql://localhost:3306/demo_ds_0?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
- username: root
- password:
- ds_1:
- dataSourceClassName: com.zaxxer.hikari.HikariDataSource
- driverClassName: com.mysql.jdbc.Driver
- jdbcUrl: jdbc:mysql://localhost:3306/demo_ds_1?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
- username: root
- password:
-
-rules:
-- !SHARDING
- tables:
- t_order:
- actualDataNodes: ds_${0..1}.t_order
- keyGenerateStrategy:
- column: order_id
- keyGeneratorName: snowflake
- t_order_item:
- actualDataNodes: ds_${0..1}.t_order_item
- keyGenerateStrategy:
- column: order_item_id
- keyGeneratorName: snowflake
- bindingTables:
- - t_order,t_order_item
- broadcastTables:
- - t_address
- defaultDatabaseStrategy:
- standard:
- shardingColumn: user_id
- shardingAlgorithmName: database_classbased
- defaultTableStrategy:
- none:
-
- shardingAlgorithms:
- database_classbased:
- type: CLASS_BASED
- props:
- strategy: standard
- algorithmClassName: org.apache.shardingsphere.example.extension.sharding.algortihm.classbased.fixture.ClassBasedStandardShardingAlgorithmFixture
-
- keyGenerators:
- snowflake:
- type: SNOWFLAKE
- props:
- worker-id: 123
-
-props:
- sql-show: false
diff --git a/examples/shardingsphere-jdbc-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/src/main/resources/logback.xml b/examples/shardingsphere-jdbc-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/src/main/resources/logback.xml
deleted file mode 100644
index 879ec20..0000000
--- a/examples/shardingsphere-jdbc-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-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="class-based-sharding-algorithm-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/extension-example/custom-sharding-algortihm-example/pom.xml b/examples/shardingsphere-jdbc-example/extension-example/custom-sharding-algortihm-example/pom.xml
deleted file mode 100644
index a6197ab..0000000
--- a/examples/shardingsphere-jdbc-example/extension-example/custom-sharding-algortihm-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>extension-example</artifactId>
- <version>5.0.0-RC1-SNAPSHOT</version>
- </parent>
- <artifactId>custom-sharding-algortihm-example</artifactId>
- <name>${project.artifactId}</name>
- <packaging>pom</packaging>
-
- <modules>
- <module>class-based-sharding-algorithm-example</module>
- </modules>
-</project>
diff --git a/examples/shardingsphere-jdbc-example/extension-example/pom.xml b/examples/shardingsphere-jdbc-example/extension-example/pom.xml
deleted file mode 100644
index ba67c96..0000000
--- a/examples/shardingsphere-jdbc-example/extension-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>extension-example</artifactId>
- <name>${project.artifactId}</name>
- <packaging>pom</packaging>
-
- <modules>
- <module>custom-sharding-algortihm-example</module>
- </modules>
-</project>
diff --git a/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-raw-jdbc-example/pom.xml b/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-raw-jdbc-example/pom.xml
deleted file mode 100644
index c246669..0000000
--- a/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-raw-jdbc-example/pom.xml
+++ /dev/null
@@ -1,42 +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>encrypt-example</artifactId>
- <version>5.0.0-RC1-SNAPSHOT</version>
- </parent>
- <artifactId>encrypt-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/encrypt-example/encrypt-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/encrypt/table/raw/jdbc/EncryptRawJavaConfigurationExample.java b/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/encrypt/table/raw/jdbc/EncryptRawJavaConfigurationExample.java
deleted file mode 100644
index 2665172..0000000
--- a/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/encrypt/table/raw/jdbc/EncryptRawJavaConfigurationExample.java
+++ /dev/null
@@ -1,43 +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.
- */
-
-/*
- * Please make sure primary replica data replication sync on MySQL is running correctly. Otherwise this example will query empty data from replica.
- */
-
-package org.apache.shardingsphere.example.encrypt.table.raw.jdbc;
-
-import org.apache.shardingsphere.example.core.api.ExampleExecuteTemplate;
-import org.apache.shardingsphere.example.core.api.service.ExampleService;
-import org.apache.shardingsphere.example.core.jdbc.repository.UserRepositoryImpl;
-import org.apache.shardingsphere.example.core.jdbc.service.UserServiceImpl;
-import org.apache.shardingsphere.example.encrypt.table.raw.jdbc.config.EncryptDatabasesConfiguration;
-
-import javax.sql.DataSource;
-import java.sql.SQLException;
-
-public final class EncryptRawJavaConfigurationExample {
-
- public static void main(final String[] args) throws SQLException {
- DataSource dataSource = new EncryptDatabasesConfiguration().getDataSource();
- ExampleExecuteTemplate.run(getExampleService(dataSource));
- }
-
- private static ExampleService getExampleService(final DataSource dataSource) {
- return new UserServiceImpl(new UserRepositoryImpl(dataSource));
- }
-}
diff --git a/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/encrypt/table/raw/jdbc/EncryptRawYamlConfigurationExample.java b/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/encrypt/table/raw/jdbc/EncryptRawYamlConfigurationExample.java
deleted file mode 100644
index 5886aaa..0000000
--- a/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/encrypt/table/raw/jdbc/EncryptRawYamlConfigurationExample.java
+++ /dev/null
@@ -1,45 +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.encrypt.table.raw.jdbc;
-
-import org.apache.shardingsphere.example.core.api.ExampleExecuteTemplate;
-import org.apache.shardingsphere.example.core.api.service.ExampleService;
-import org.apache.shardingsphere.example.core.jdbc.repository.UserRepositoryImpl;
-import org.apache.shardingsphere.example.core.jdbc.service.UserServiceImpl;
-import org.apache.shardingsphere.driver.api.yaml.YamlShardingSphereDataSourceFactory;
-
-import javax.sql.DataSource;
-import java.io.File;
-import java.io.IOException;
-import java.sql.SQLException;
-
-public final class EncryptRawYamlConfigurationExample {
-
- public static void main(final String[] args) throws SQLException, IOException {
- DataSource dataSource = YamlShardingSphereDataSourceFactory.createDataSource(getFile());
- ExampleExecuteTemplate.run(getExampleService(dataSource));
- }
-
- private static File getFile() {
- return new File(EncryptRawYamlConfigurationExample.class.getResource("/META-INF/encrypt-databases.yaml").getFile());
- }
-
- private static ExampleService getExampleService(final DataSource dataSource) {
- return new UserServiceImpl(new UserRepositoryImpl(dataSource));
- }
-}
diff --git a/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/encrypt/table/raw/jdbc/config/EncryptDatabasesConfiguration.java b/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/encrypt/table/raw/jdbc/config/EncryptDatabasesConfiguration.java
deleted file mode 100644
index a0a6790..0000000
--- a/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/encrypt/table/raw/jdbc/config/EncryptDatabasesConfiguration.java
+++ /dev/null
@@ -1,56 +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.encrypt.table.raw.jdbc.config;
-
-import org.apache.shardingsphere.driver.api.ShardingSphereDataSourceFactory;
-import org.apache.shardingsphere.encrypt.api.config.EncryptRuleConfiguration;
-import org.apache.shardingsphere.encrypt.api.config.rule.EncryptColumnRuleConfiguration;
-import org.apache.shardingsphere.encrypt.api.config.rule.EncryptTableRuleConfiguration;
-import org.apache.shardingsphere.example.config.ExampleConfiguration;
-import org.apache.shardingsphere.example.core.api.DataSourceUtil;
-import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
-
-import javax.sql.DataSource;
-import java.sql.SQLException;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Properties;
-
-public final class EncryptDatabasesConfiguration implements ExampleConfiguration {
-
- @Override
- public DataSource getDataSource() {
- Properties props = new Properties();
- props.setProperty("aes-key-value", "123456");
- EncryptColumnRuleConfiguration columnConfigAes = new EncryptColumnRuleConfiguration("user_name", "user_name", "", "user_name_plain", "name_encryptor");
- EncryptColumnRuleConfiguration columnConfigTest = new EncryptColumnRuleConfiguration("pwd", "pwd", "assisted_query_pwd", "", "pwd_encryptor");
- EncryptTableRuleConfiguration encryptTableRuleConfig = new EncryptTableRuleConfiguration("t_user", Arrays.asList(columnConfigAes, columnConfigTest));
- Map<String, ShardingSphereAlgorithmConfiguration> encryptAlgorithmConfigs = new LinkedHashMap<>(2, 1);
- encryptAlgorithmConfigs.put("name_encryptor", new ShardingSphereAlgorithmConfiguration("AES", props));
- encryptAlgorithmConfigs.put("pwd_encryptor", new ShardingSphereAlgorithmConfiguration("assistedTest", props));
- EncryptRuleConfiguration encryptRuleConfig = new EncryptRuleConfiguration(Collections.singleton(encryptTableRuleConfig), encryptAlgorithmConfigs);
- try {
- return ShardingSphereDataSourceFactory.createDataSource(DataSourceUtil.createDataSource("demo_ds"), Collections.singleton(encryptRuleConfig), props);
- } catch (final SQLException ex) {
- ex.printStackTrace();
- return null;
- }
- }
-}
diff --git a/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-raw-jdbc-example/src/main/resources/META-INF/encrypt-databases.yaml b/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-raw-jdbc-example/src/main/resources/META-INF/encrypt-databases.yaml
deleted file mode 100644
index 5cececa..0000000
--- a/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-raw-jdbc-example/src/main/resources/META-INF/encrypt-databases.yaml
+++ /dev/null
@@ -1,45 +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.
-#
-
-dataSources:
- unique_ds:
- dataSourceClassName: com.zaxxer.hikari.HikariDataSource
- driverClassName: com.mysql.jdbc.Driver
- jdbcUrl: jdbc:mysql://localhost:3306/demo_ds?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
- username: root
- password:
-
-rules:
-- !ENCRYPT
- tables:
- t_user:
- columns:
- user_name:
- plainColumn: user_name_plain
- cipherColumn: user_name
- encryptorName: name_encryptor
- pwd:
- cipherColumn: pwd
- assistedQueryColumn: assisted_query_pwd
- encryptorName: pwd_encryptor
- encryptors:
- name_encryptor:
- type: AES
- props:
- aes-key-value: 123456abc
- pwd_encryptor:
- type: assistedTest
diff --git a/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-raw-jdbc-example/src/main/resources/logback.xml b/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-raw-jdbc-example/src/main/resources/logback.xml
deleted file mode 100644
index 053716e..0000000
--- a/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-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="encrypt-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/encrypt-example/encrypt-spring-boot-mybatis-example/pom.xml b/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-spring-boot-mybatis-example/pom.xml
deleted file mode 100644
index c3f896b..0000000
--- a/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-spring-boot-mybatis-example/pom.xml
+++ /dev/null
@@ -1,50 +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>encrypt-example</artifactId>
- <version>5.0.0-RC1-SNAPSHOT</version>
- </parent>
- <artifactId>encrypt-spring-boot-mybatis-example</artifactId>
- <name>${project.artifactId}</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.shardingsphere.example</groupId>
- <artifactId>example-spring-mybatis</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-jdbc-core-spring-boot-starter</artifactId>
- </dependency>
- <dependency>
- <groupId>org.mybatis.spring.boot</groupId>
- <artifactId>mybatis-spring-boot-starter</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-test</artifactId>
- </dependency>
- </dependencies>
-</project>
diff --git a/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-spring-boot-mybatis-example/src/main/java/org/apache/shardingsphere/example/encrypt/table/spring/boot/mybatis/EncryptSpringBootMybatisExample.java b/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-spring-boot-mybatis-example/src/main/java/org/apache/shardingsphere/example/encrypt/table/spring/boot/mybatis/EncryptSpringBootMybatisExample.java
deleted file mode 100644
index 8b3689d..0000000
--- a/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-spring-boot-mybatis-example/src/main/java/org/apache/shardingsphere/example/encrypt/table/spring/boot/mybatis/EncryptSpringBootMybatisExample.java
+++ /dev/null
@@ -1,41 +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.encrypt.table.spring.boot.mybatis;
-
-import org.apache.shardingsphere.example.core.api.ExampleExecuteTemplate;
-import org.apache.shardingsphere.example.core.api.service.ExampleService;
-import org.mybatis.spring.annotation.MapperScan;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.autoconfigure.transaction.jta.JtaAutoConfiguration;
-import org.springframework.context.ConfigurableApplicationContext;
-import org.springframework.context.annotation.ComponentScan;
-
-import java.sql.SQLException;
-
-@ComponentScan("org.apache.shardingsphere.example.core.mybatis")
-@MapperScan(basePackages = "org.apache.shardingsphere.example.core.mybatis.repository")
-@SpringBootApplication(exclude = JtaAutoConfiguration.class)
-public class EncryptSpringBootMybatisExample {
-
- public static void main(final String[] args) throws SQLException {
- try (ConfigurableApplicationContext applicationContext = SpringApplication.run(EncryptSpringBootMybatisExample.class, args)) {
- ExampleExecuteTemplate.run(applicationContext.getBean("encrypt", ExampleService.class));
- }
- }
-}
diff --git a/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-spring-boot-mybatis-example/src/main/resources/META-INF/mybatis-config.xml b/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-spring-boot-mybatis-example/src/main/resources/META-INF/mybatis-config.xml
deleted file mode 100644
index a24bcef..0000000
--- a/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-spring-boot-mybatis-example/src/main/resources/META-INF/mybatis-config.xml
+++ /dev/null
@@ -1,26 +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.
- -->
-
-<!DOCTYPE configuration
- PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-config.dtd">
-<configuration>
- <mappers>
- <mapper resource="META-INF/mappers/UserMapper.xml"/>
- </mappers>
-</configuration>
diff --git a/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-spring-boot-mybatis-example/src/main/resources/application-encrypt-databases.properties b/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-spring-boot-mybatis-example/src/main/resources/application-encrypt-databases.properties
deleted file mode 100644
index 55df84e..0000000
--- a/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-spring-boot-mybatis-example/src/main/resources/application-encrypt-databases.properties
+++ /dev/null
@@ -1,37 +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.
-#
-
-spring.shardingsphere.datasource.names=ds
-
-spring.shardingsphere.datasource.ds.type=com.zaxxer.hikari.HikariDataSource
-spring.shardingsphere.datasource.ds.driver-class-name=com.mysql.jdbc.Driver
-spring.shardingsphere.datasource.ds.jdbc-url=jdbc:mysql://localhost:3306/demo_ds?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
-spring.shardingsphere.datasource.ds.username=root
-spring.shardingsphere.datasource.ds.password=
-
-spring.shardingsphere.rules.encrypt.encryptors.name-encryptor.type=AES
-spring.shardingsphere.rules.encrypt.encryptors.name-encryptor.props.aes-key-value=123456abc
-spring.shardingsphere.rules.encrypt.encryptors.pwd-encryptor.type=AES
-spring.shardingsphere.rules.encrypt.encryptors.pwd-encryptor.props.aes-key-value=123456abc
-
-spring.shardingsphere.rules.encrypt.tables.t_user.columns.user_name.cipher-column=user_name
-spring.shardingsphere.rules.encrypt.tables.t_user.columns.user_name.encryptor-name=name-encryptor
-spring.shardingsphere.rules.encrypt.tables.t_user.columns.pwd.cipher-column=pwd
-spring.shardingsphere.rules.encrypt.tables.t_user.columns.pwd.encryptor-name=pwd-encryptor
-
-spring.shardingsphere.props.query-with-cipher-comlum=true
-spring.shardingsphere.props.sql-show=true
diff --git a/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-spring-boot-mybatis-example/src/main/resources/application.properties b/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-spring-boot-mybatis-example/src/main/resources/application.properties
deleted file mode 100644
index 1f8d898..0000000
--- a/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-spring-boot-mybatis-example/src/main/resources/application.properties
+++ /dev/null
@@ -1,20 +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.
-#
-
-mybatis.config-location=classpath:META-INF/mybatis-config.xml
-
-spring.profiles.active=encrypt-databases
diff --git a/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-spring-boot-mybatis-example/src/main/resources/logback.xml b/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-spring-boot-mybatis-example/src/main/resources/logback.xml
deleted file mode 100644
index 3718395..0000000
--- a/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-spring-boot-mybatis-example/src/main/resources/logback.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.
- -->
-
-<configuration>
- <property name="log.context.name" value="encrypt-spring-boot-mybatis-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>
- <logger name="org.springframework" level="WARN" />
- <logger name="com.zaxxer.hikari" level="WARN" />
- <root>
- <level value="INFO" />
- <appender-ref ref="STDOUT" />
- </root>
-</configuration>
diff --git a/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-spring-namespace-mybatis-example/pom.xml b/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-spring-namespace-mybatis-example/pom.xml
deleted file mode 100644
index 2a51487..0000000
--- a/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-spring-namespace-mybatis-example/pom.xml
+++ /dev/null
@@ -1,42 +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>encrypt-example</artifactId>
- <version>5.0.0-RC1-SNAPSHOT</version>
- </parent>
- <artifactId>encrypt-spring-namespace-mybatis-example</artifactId>
- <name>${project.artifactId}</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.shardingsphere.example</groupId>
- <artifactId>example-spring-mybatis</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-jdbc-core-spring-namespace</artifactId>
- </dependency>
- </dependencies>
-</project>
diff --git a/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-spring-namespace-mybatis-example/src/main/java/org/apache/shardingsphere/example/encrypt/table/spring/namespace/mybatis/EncryptSpringNamespaceMybatisExample.java b/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-spring-namespace-mybatis-example/src/main/java/org/apache/shardingsphere/example/encrypt/table/spring/namespace/mybatis/EncryptSpringNamespaceMybatisE [...]
deleted file mode 100644
index b2611da..0000000
--- a/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-spring-namespace-mybatis-example/src/main/java/org/apache/shardingsphere/example/encrypt/table/spring/namespace/mybatis/EncryptSpringNamespaceMybatisExample.java
+++ /dev/null
@@ -1,36 +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.encrypt.table.spring.namespace.mybatis;
-
-import org.apache.shardingsphere.example.core.api.ExampleExecuteTemplate;
-import org.apache.shardingsphere.example.core.api.service.ExampleService;
-import org.springframework.context.ConfigurableApplicationContext;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
-
-import java.sql.SQLException;
-
-public final class EncryptSpringNamespaceMybatisExample {
-
- private static final String CONFIG_FILE = "META-INF/application-encrypt-databases.xml";
-
- public static void main(final String[] args) throws SQLException {
- try (ConfigurableApplicationContext applicationContext = new ClassPathXmlApplicationContext(CONFIG_FILE)) {
- ExampleExecuteTemplate.run(applicationContext.getBean("encrypt", ExampleService.class));
- }
- }
-}
diff --git a/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-spring-namespace-mybatis-example/src/main/resources/META-INF/application-encrypt-databases.xml b/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-spring-namespace-mybatis-example/src/main/resources/META-INF/application-encrypt-databases.xml
deleted file mode 100644
index 9dcce7d..0000000
--- a/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-spring-namespace-mybatis-example/src/main/resources/META-INF/application-encrypt-databases.xml
+++ /dev/null
@@ -1,75 +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.
- -->
-
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:shardingsphere="http://shardingsphere.apache.org/schema/shardingsphere/datasource"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:tx="http://www.springframework.org/schema/tx"
- xmlns:encrypt="http://shardingsphere.apache.org/schema/shardingsphere/encrypt"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/tx
- http://www.springframework.org/schema/tx/spring-tx.xsd
- http://www.springframework.org/schema/context
- http://www.springframework.org/schema/context/spring-context.xsd
- http://shardingsphere.apache.org/schema/shardingsphere/datasource
- http://shardingsphere.apache.org/schema/shardingsphere/datasource/datasource.xsd
- http://shardingsphere.apache.org/schema/shardingsphere/encrypt
- http://shardingsphere.apache.org/schema/shardingsphere/encrypt/encrypt.xsd
- ">
- <context:component-scan base-package="org.apache.shardingsphere.example.core.mybatis" />
-
- <bean id="ds" class="com.zaxxer.hikari.HikariDataSource" destroy-method="close">
- <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
- <property name="jdbcUrl" value="jdbc:mysql://localhost:3306/demo_ds?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8"/>
- <property name="username" value="root"/>
- <property name="password" value=""/>
- </bean>
-
- <encrypt:encrypt-algorithm id="name_encryptor" type="AES">
- <props>
- <prop key="aes-key-value">123456</prop>
- </props>
- </encrypt:encrypt-algorithm>
- <encrypt:encrypt-algorithm id="pwd_encryptor" type="assistedTest" />
-
- <encrypt:rule id="encryptRule">
- <encrypt:table name="t_user">
- <encrypt:column logic-column="user_name" cipher-column="user_name" plain-column="user_name_plain" encrypt-algorithm-ref="name_encryptor" />
- <encrypt:column logic-column="pwd" cipher-column="pwd" assisted-query-column="assisted_query_pwd" encrypt-algorithm-ref="pwd_encryptor" />
- </encrypt:table>
- </encrypt:rule>
-
- <shardingsphere:data-source id="encryptDataSource" data-source-names="ds" rule-refs="encryptRule" />
-
- <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
- <property name="dataSource" ref="encryptDataSource" />
- </bean>
- <tx:annotation-driven />
-
- <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
- <property name="dataSource" ref="encryptDataSource"/>
- <property name="mapperLocations" value="classpath*:META-INF/mappers/*.xml"/>
- </bean>
-
- <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
- <property name="basePackage" value="org.apache.shardingsphere.example.core.mybatis.repository"/>
- <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/>
- </bean>
-</beans>
diff --git a/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-spring-namespace-mybatis-example/src/main/resources/logback.xml b/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-spring-namespace-mybatis-example/src/main/resources/logback.xml
deleted file mode 100644
... 13322 lines suppressed ...