This is an automated email from the ASF dual-hosted git repository.
totalo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 1dcfb9ca17d Fix encrypt examples EncryptColumnRuleConfiguration
constructor (#18067)
1dcfb9ca17d is described below
commit 1dcfb9ca17d27937800868e4651dd85398f372ae
Author: zhaoguhong <[email protected]>
AuthorDate: Mon May 30 20:02:05 2022 +0800
Fix encrypt examples EncryptColumnRuleConfiguration constructor (#18067)
* Fix encrypt examples EncryptColumnRuleConfiguration constructor
* Refactor TestQueryAssistedShardingEncryptAlgorithm
---
.../jdbc/java/TestQueryAssistedShardingEncryptAlgorithm.ftl | 7 +++++--
.../src/main/resources/template/jdbc/java/config/encrypt.ftl | 4 ++--
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git
a/examples/shardingsphere-example-generator/src/main/resources/template/jdbc/java/TestQueryAssistedShardingEncryptAlgorithm.ftl
b/examples/shardingsphere-example-generator/src/main/resources/template/jdbc/java/TestQueryAssistedShardingEncryptAlgorithm.ftl
index 8ef7f513aa7..399e253c462 100644
---
a/examples/shardingsphere-example-generator/src/main/resources/template/jdbc/java/TestQueryAssistedShardingEncryptAlgorithm.ftl
+++
b/examples/shardingsphere-example-generator/src/main/resources/template/jdbc/java/TestQueryAssistedShardingEncryptAlgorithm.ftl
@@ -27,8 +27,6 @@ import java.util.Properties;
public final class TestQueryAssistedShardingEncryptAlgorithm implements
QueryAssistedEncryptAlgorithm<Object, String> {
- @Getter
- @Setter
private Properties props;
@Override
@@ -50,4 +48,9 @@ public final class TestQueryAssistedShardingEncryptAlgorithm
implements QueryAss
public String getType() {
return "assistedTest";
}
+
+ @Override
+ public void init(Properties props) {
+ this.props = props;
+ }
}
diff --git
a/examples/shardingsphere-example-generator/src/main/resources/template/jdbc/java/config/encrypt.ftl
b/examples/shardingsphere-example-generator/src/main/resources/template/jdbc/java/config/encrypt.ftl
index 92a1d5d9fb9..8869186e43a 100644
---
a/examples/shardingsphere-example-generator/src/main/resources/template/jdbc/java/config/encrypt.ftl
+++
b/examples/shardingsphere-example-generator/src/main/resources/template/jdbc/java/config/encrypt.ftl
@@ -18,8 +18,8 @@
private EncryptRuleConfiguration createEncryptRuleConfiguration() {
Properties props = new Properties();
props.setProperty("aes-key-value", "123456");
- EncryptColumnRuleConfiguration columnConfigAes = new
EncryptColumnRuleConfiguration("phone", "phone", "", "phone_plain",
"phone_encryptor");
- EncryptColumnRuleConfiguration columnConfigTest = new
EncryptColumnRuleConfiguration("status", "status", "assisted_query_status", "",
"string_encryptor");
+ EncryptColumnRuleConfiguration columnConfigAes = new
EncryptColumnRuleConfiguration("phone", "phone", "", "phone_plain",
"phone_encryptor", null);
+ EncryptColumnRuleConfiguration columnConfigTest = new
EncryptColumnRuleConfiguration("status", "status", "assisted_query_status", "",
"string_encryptor", null);
EncryptTableRuleConfiguration orderItemRule = new
EncryptTableRuleConfiguration("t_order_item",
Collections.singleton(columnConfigAes), true);
EncryptTableRuleConfiguration orderRule = new
EncryptTableRuleConfiguration("t_order",
Collections.singleton(columnConfigTest), true);
Map<String, ShardingSphereAlgorithmConfiguration>
encryptAlgorithmConfigs = new LinkedHashMap<>();