This is an automated email from the ASF dual-hosted git repository.

duanzhengqiang 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 d16a7eae6ee fix encrypt example error (#26102)
d16a7eae6ee is described below

commit d16a7eae6eea17c841f4f495bf5f28272b1544c3
Author: Guocheng Tang <[email protected]>
AuthorDate: Wed Jun 7 22:21:01 2023 +0800

    fix encrypt example error (#26102)
    
    * fix encrypt example error
    
    * update column
---
 .../main/resources/template/jdbc/java/config/encrypt.ftl   | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

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 22d5b8e330b..71ed2c3bcf5 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,12 +18,14 @@
     private EncryptRuleConfiguration createEncryptRuleConfiguration() {
         Properties props = new Properties();
         props.setProperty("aes-key-value", "123456");
-        EncryptColumnRuleConfiguration columnConfigAes = new 
EncryptColumnRuleConfiguration("phone", "phone", "", "", "phone_plain", 
"phone_encryptor", null);
-        EncryptColumnRuleConfiguration columnConfigTest = new 
EncryptColumnRuleConfiguration("status", "status", "assisted_query_status", "", 
"", "string_encryptor", "string_encryptor", null, null);
-        EncryptTableRuleConfiguration orderItemRule = new 
EncryptTableRuleConfiguration("t_order_item", 
Collections.singleton(columnConfigAes), true);
-        EncryptTableRuleConfiguration orderRule = new 
EncryptTableRuleConfiguration("t_order", 
Collections.singleton(columnConfigTest), true);
+        EncryptColumnRuleConfiguration columnConfigAes = new 
EncryptColumnRuleConfiguration("phone", new 
EncryptColumnItemRuleConfiguration("phone", "standard_encryptor"));
+        EncryptTableRuleConfiguration orderItemRule = new 
EncryptTableRuleConfiguration("t_order_item", 
Collections.singleton(columnConfigAes));
+        EncryptColumnRuleConfiguration statusColumnConfig =
+            new EncryptColumnRuleConfiguration("status", new 
EncryptColumnItemRuleConfiguration("status", "standard_encryptor"));
+        statusColumnConfig.setAssistedQuery(new 
EncryptColumnItemRuleConfiguration("status_assisted", "assisted_encryptor"));
+        EncryptTableRuleConfiguration orderRule = new 
EncryptTableRuleConfiguration("t_order", 
Collections.singleton(statusColumnConfig)); 
         Map<String, AlgorithmConfiguration> encryptAlgorithmConfigs = new 
LinkedHashMap<>();
-        encryptAlgorithmConfigs.put("phone_encryptor", new 
AlgorithmConfiguration("AES", props));
-        encryptAlgorithmConfigs.put("string_encryptor", new 
AlgorithmConfiguration("assistedTest", props));
+        encryptAlgorithmConfigs.put("standard_encryptor", new 
AlgorithmConfiguration("AES", props));
+        encryptAlgorithmConfigs.put("assisted_encryptor", new 
AlgorithmConfiguration("assistedTest", props));
         return new EncryptRuleConfiguration(Arrays.asList(orderRule, 
orderItemRule), encryptAlgorithmConfigs);
     }

Reply via email to