This is an automated email from the ASF dual-hosted git repository.
zhaojinchao 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 fe81991 Update readme of shardingsphere-example-generator (#16396)
fe81991 is described below
commit fe81991d45debe977fdd3a15a33ca9a53a245eda
Author: Liang Zhang <[email protected]>
AuthorDate: Sat Mar 26 19:20:53 2022 +0800
Update readme of shardingsphere-example-generator (#16396)
---
.../spring-namespace/rules/sql-parser.cn.md | 20 ++++-----
.../shardingsphere-example-generator/README.md | 52 +++++++++-------------
.../shardingsphere-example-generator/README_ZH.md | 52 +++++++++-------------
3 files changed, 50 insertions(+), 74 deletions(-)
diff --git
a/docs/document/content/user-manual/shardingsphere-jdbc/spring-namespace/rules/sql-parser.cn.md
b/docs/document/content/user-manual/shardingsphere-jdbc/spring-namespace/rules/sql-parser.cn.md
index 40df090..3963dca 100644
---
a/docs/document/content/user-manual/shardingsphere-jdbc/spring-namespace/rules/sql-parser.cn.md
+++
b/docs/document/content/user-manual/shardingsphere-jdbc/spring-namespace/rules/sql-parser.cn.md
@@ -9,18 +9,18 @@ weight = 6
\<sql-parser:rule />
-| *名称* | *类型* | *说明* |
-|--------------------------|------|----------------|
-| id | 属性 | Spring Bean Id |
+| *名称* | *类型* | *说明* |
+|--------------------------|-------|--------------------|
+| id | 属性 | Spring Bean Id |
| sql-comment-parse-enable | 属性 | 是否解析 SQL 注释 |
-| parse-tree-cache-ref | 属性 | 解析树本地缓存名称 |
-| sql-statement-cache-ref | 属性 | SQL 语句本地缓存名称 |
+| parse-tree-cache-ref | 属性 | 解析树本地缓存名称 |
+| sql-statement-cache-ref | 属性 | SQL 语句本地缓存名称 |
\<sql-parser:cache-option />
-| *名称* | *类型* | *说明* |
-|-----------------------------| ----- |--------------------|
-| id | 属性 | 本地缓存配置项名称 |
-| initial-capacity | 属性 | 本地缓存初始容量 |
-| maximum-size | 属性 | 本地缓存最大容量 |
+| *名称* | *类型* | *说明* |
+|-----------------------------| ----- |-------------------------------------|
+| id | 属性 | 本地缓存配置项名称 |
+| initial-capacity | 属性 | 本地缓存初始容量 |
+| maximum-size | 属性 | 本地缓存最大容量 |
| concurrency-level | 属性 | 本地缓存并发级别,最多允许线程并发更新的个数 |
diff --git a/examples/shardingsphere-example-generator/README.md
b/examples/shardingsphere-example-generator/README.md
index 878db34..252fd07 100644
--- a/examples/shardingsphere-example-generator/README.md
+++ b/examples/shardingsphere-example-generator/README.md
@@ -1,41 +1,29 @@
-# Automatic example codes generator
+# Example codes generator of ShardingSphere
-shardingsphere-example-generator is an example code generation module based on
the freemarker template engine. Data and template can generate the required
code examples.
+Project uses freemarker template engine to generate example codes of
ShardingSphere.
-## Template
+## Usage
-shardingsphere-example-generator has defined relevant templates, users do not
need to pay attention when using them. The relevant templates are in the
template folder under the `resources` directory. If there are any errors,
please correct them.
+1. Configure parameter
-## Data
+File: `src/main/resources/data-model/data-model.yaml`
-Data is the core of template generation. Based on data, we inject soul into
our template and generate running code. The specific data model is as follows:
+2. Generate code
-| property | Description | Reference
|
-|:--------------------|--------------------|:----------------------------------------------------------------------------------------------------------------------------------|
-| product | product | jdbc、proxy
|
-| mode | operating mode |
memory、cluster-zookeeper、cluster-etcd、standalone-file
|
-| transaction | transaction type | local
|
-| features | feature set |
sharding、readwrite-splitting、encrypt、db-discovery
|
-| frameworks | framework set |
jdbc、spring-boot-starter-jdbc、spring-boot-starter-jpa、spring-boot-starter-mybatis、spring-namespace-jpa、spring-namespace-mybatis
|
-| host | database host | localhost
|
-| port | database port | 3306
|
-| username | database username | root
|
-| password | database password | root
|
+Run `org.apache.shardingsphere.example.generator.ExampleGeneratorMain` to
generate example codes.
-## Steps
+Generated codes: `target/generated-sources/shardingsphere-${product}-sample`
-1、Configure the data model
+## Configuration Item Explanation
-In the resource directory of the `shardingsphere-example-generator` module,
configure the `data-model.yaml` file.
-
-2、Generate code
-
-Run `ExampleGeneratorMain` to generate the corresponding module code in the
`target/generated-sources/shardingsphere-${product}-sample` directory.
-
-3、Compile
-
-Mark the generated code as a maven project, and in the relevant directory
file, run `mvn clean compile`.
-
-4、Run
-
-Run the `Example#main` method in the java directory of the generated module to
run the relevant code examples.
\ No newline at end of file
+| *Name* | *Description* | *Options*
|
+|:------------|-------------------|:-------------------------------------------------------------------------------------------------------------------------------------|
+| product | product | jdbc, proxy
|
+| mode | operating mode | memory, cluster-zookeeper, cluster-etcd,
standalone-file
|
+| transaction | transaction type | local
|
+| features | feature set | sharding, readwrite-splitting,
db-discovery, encrypt
|
+| frameworks | framework set | jdbc, spring-boot-starter-jdbc,
spring-boot-starter-jpa, spring-boot-starter-mybatis, spring-namespace-jpa,
spring-namespace-mybatis |
+| host | database host |
|
+| port | database port |
|
+| username | database username |
|
+| password | database password |
|
diff --git a/examples/shardingsphere-example-generator/README_ZH.md
b/examples/shardingsphere-example-generator/README_ZH.md
index 7761921..7ebe8c8 100644
--- a/examples/shardingsphere-example-generator/README_ZH.md
+++ b/examples/shardingsphere-example-generator/README_ZH.md
@@ -1,41 +1,29 @@
-# 自动生成代码使用示例
+# ShardingSphere 使用示例代码生成器
-shardingsphere-example-generator 是基于 freemarker 模板引擎的示例代码生成模块,数据 +
模板即可生成所需要的代码示例。
+项目基于 freemarker 模板引擎生成 ShardingSphere 使用示例代码。
-## 模板
+## 使用步骤
-shardingsphere-example-generator 已经定义好了相关模板,用户在使用时,不需要关注,相关模板在 resources 目录下的
template 文件夹,若有错误,也请指正。
+1. 配置参数
-## 数据
+文件位置:`src/main/resources/data-model/data-model.yaml`
-数据是模板生成的核心,基于数据,为我们的模板注入灵魂,生成运行的代码,具体的数据模型如下:
+2. 生成代码
-| 属性名 | 含义 | 参考值
|
-|:------------|-----------|:--------------------------------------------------------------------------------------------------------------------------------|
-| product | 所属产品 | jdbc、proxy
|
-| mode | 运行模式 |
memory、cluster-zookeeper、cluster-etcd、standalone-file
|
-| transaction | 事务类型 | local
|
-| features | 功能特性 | sharding、readwrite-splitting、encrypt、db-discovery
|
-| frameworks | 框架 |
jdbc、spring-boot-starter-jdbc、spring-boot-starter-jpa、spring-boot-starter-mybatis、spring-namespace-jpa、spring-namespace-mybatis
|
-| host | 数据库主机名 | localhost
|
-| port | 数据库端口 | 3306
|
-| username | 数据库用户名 | root
|
-| password | 数据库密码 | root
|
-
-## 生成步骤
-
-1、配置数据模型
-
-在`shardingsphere-example-generator`模块的资源目录中,配置`data-model.yaml` 文件
+运行 `org.apache.shardingsphere.example.generator.ExampleGeneratorMain`
即可生成对应的示例代码。
-2、生成代码
+生成后的代码位于:`target/generated-sources/shardingsphere-${product}-sample`
-运行`ExampleGeneratorMain`即可生成对应的模块代码在`target/generated-sources/shardingsphere-${product}-sample`目录
+## 配置项说明
-3、编译
-
-将生成的代码标记位maven工程,并且在相关目录文件下,运行`mvn clean compile`
-
-4、运行
-
-运行生成模块的 java 目录`Example#main`方法,即可运行相关的代码示例。
+| *属性名称* | *说明* | *可选项*
|
+|:------------|------------|:------------------------------------------------------------------------------------------------------------------------------------|
+| product | 产品 | jdbc、proxy
|
+| mode | 运行模式 |
memory、cluster-zookeeper、cluster-etcd、standalone-file
|
+| transaction | 事务类型 | local
|
+| features | 功能 | sharding、readwrite-splitting、db-discovery、encrypt
|
+| frameworks | 框架 |
jdbc、spring-boot-starter-jdbc、spring-boot-starter-jpa、spring-boot-starter-mybatis、spring-namespace-jpa、spring-namespace-mybatis
|
+| host | 数据库主机名 |
|
+| port | 数据库端口 |
|
+| username | 数据库用户名 |
|
+| password | 数据库密码 |
|