Issue 1:
Bug Report

I followed this article https://my.oschina.net/u/3867294/blog/3089014 to encry my data.

When I'm using the following configuration, the program insert data successfully,but throw an exception when querying it. I found out the program trys to decrypt user_name, while user_name is not encrypted , yet user_name_encrypt is .

spring:
shardingsphere:
datasource:
names: ds0
ds0:
type: org.apache.commons.dbcp2.BasicDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url:
username:
password:
encrypt:
encryptors:
encryptor_aes:
type: aes
props:
aes.key.value: 123456
tables:
user:
columns:
user_name:
logicColumn: user_name
plainColumn: user_name
cipherColumn: user_name_encrypt
encryptor: encryptor_aes
props:
sql.show: false
query.with.cipher.column: false

The sql query

select * from user

create table user
(
id int auto_increment
primary key,
user_name varchar(200) null,
age int null,
email varchar(200) null,
user_name_encrypt varchar(200) null
)

Before report a bug, make sure you have:

Searched open and closed GitHub issues.

Read documentation: ShardingSphere Doc.

Please pay attention on issues you submitted, because we maybe need more details.

If no response more than 7 days and we cannot reproduce it on current information, we will close it.

Please answer these questions before submitting your issue. Thanks!

Which version of ShardingSphere did you use?

4.0.0-RC2

Which project did you use? Sharding-JDBC or Sharding-Proxy?

Sharding-JDBC

Expected behavior

get correct value of the column

Actual behavior

program trys to decrypt the unencrypted column

Reason analyze (If you can)

Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.

Example codes for reproduce this issue (such as a github link).

Issue 2:
The current example is not good enough. It is difficult to understand, which users can not find their desired example codes quickly, the disadvantages are:

The categories of examples are not in same abstract level, they are not show the overview of ShardingSphere features and structure clearly;

The example-core module is too complicated which contains too many common and abstract codes, user do not need to understander them. It is better to use "flat" codes and make them independent each other;

Proxy and JDBC need to provide configurations for multiple dimensions, such as different modes, different kernel providers and different feature configs;

JDBC example can be split to different adaptors, such as jdbc, spring boot starter & jdbc, spring boot starter & jpa, spring boot starter & mybatis, spring namespace & jdbc, spring namespace & jpa and , spring namespace & mybatis;

Proxy do not need java connect example, config only is enough.

It is more clear if adjust example structure as:

shardingsphere-example
├- shardingsphere-jdbc-example
├- shardingsphere-jdbc-${mode}-example
├- shardingsphere-jdbc-${mode}-${transaction}-${feature}-example
├- shardingsphere-jdbc-${mode}-${transaction}-${feature}-${framework}-example
├- shardingsphere-proxy-example
├- shardingsphere-proxy-${mode}-example
├- shardingsphere-proxy-${mode}-${transaction}-${feature}-example
├- shardingsphere-parser-example

${xxx} are variables which can be replaced by:

${mode}: memory, standalone-file, cluster-zookeeper, cluster-etcd

${transaction}: local, xa-atomikos, xa-bitronix, xa-narayana, base-seata

${feature}: sharding, readwrite-splitting, db-discovery, encrypt, shadow and all permutation of them

${framework}: jdbc, springboot-starter-jdbc, springboot-starter-jpa, springboot-starter-mybatis, springnamespace-jdbc, springnamespace-jpa, spring-namespace-mybatis

The duplicated codes may consider about using code-generation engine.