From c4faae123f71791805bd9dc6f6f9ed4338463d4d Mon Sep 17 00:00:00 2001 From: 2b3c511 Date: Wed, 4 Jun 2025 14:14:06 +0800 Subject: [PATCH 1/2] add default param --- examples/mybatis-generator/readme.md | 8 ++- .../src/main/resources/generatorConfig.xml | 2 +- .../resources/generatorConfigByExample.xml | 58 +++++++++++++++++++ 3 files changed, 65 insertions(+), 3 deletions(-) create mode 100644 examples/mybatis-generator/src/main/resources/generatorConfigByExample.xml diff --git a/examples/mybatis-generator/readme.md b/examples/mybatis-generator/readme.md index 7cbdab8a..9bc8d489 100644 --- a/examples/mybatis-generator/readme.md +++ b/examples/mybatis-generator/readme.md @@ -45,7 +45,7 @@ use test; ``` Then we need to create a database 'table' ``` -CREATE TABLE mix3 ( +CREATE TABLE mix ( time TIMESTAMP TIME, region STRING TAG, plant_id STRING TAG, @@ -87,7 +87,10 @@ CREATE TABLE mix3 ( ### 5. put The generatorConfig.xml in your project -The location of the ` configurationFile ` configuration ` generatorConfig.xml ` file can be found in the ` src/main/resources ` template of this project for reference` Copy its content and place it in the corresponding location +- `src/main/resources/generatorConfig.xml` +each table generates an entity object +- `src/main/resources/generatorConfigByExample.xml` + The generated object will contain many "by Example" methods. If you do not want to generate these, you can configure to cancel them in the subsequent table elements ### 6. exec 'mvn mybatis-generator:generate' @@ -99,6 +102,7 @@ You can see the target file in your Project ``` org/apache/iotdb/mybatis/plugin/model/Mix.java +org/apache/iotdb/mybatis/plugin/model/MixExample.java org/apache/iotdb/mybatis/plugin/mapper/MixMapper.java org/apache/iotdb/mybatis/plugin/xml/MixMapper.xml ``` diff --git a/examples/mybatis-generator/src/main/resources/generatorConfig.xml b/examples/mybatis-generator/src/main/resources/generatorConfig.xml index 530ff4ff..db1a991e 100644 --- a/examples/mybatis-generator/src/main/resources/generatorConfig.xml +++ b/examples/mybatis-generator/src/main/resources/generatorConfig.xml @@ -51,7 +51,7 @@ - +
diff --git a/examples/mybatis-generator/src/main/resources/generatorConfigByExample.xml b/examples/mybatis-generator/src/main/resources/generatorConfigByExample.xml new file mode 100644 index 00000000..63b45598 --- /dev/null +++ b/examples/mybatis-generator/src/main/resources/generatorConfigByExample.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
From c6e51bd0511914c9b7f2dc02cb2a52a1240de541 Mon Sep 17 00:00:00 2001 From: CritasWang Date: Wed, 4 Jun 2025 15:21:10 +0800 Subject: [PATCH 2/2] Update readme.md --- examples/mybatis-generator/readme.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/mybatis-generator/readme.md b/examples/mybatis-generator/readme.md index 9bc8d489..3d26403d 100644 --- a/examples/mybatis-generator/readme.md +++ b/examples/mybatis-generator/readme.md @@ -88,9 +88,12 @@ CREATE TABLE mix ( ### 5. put The generatorConfig.xml in your project - `src/main/resources/generatorConfig.xml` + each table generates an entity object + - `src/main/resources/generatorConfigByExample.xml` - The generated object will contain many "by Example" methods. If you do not want to generate these, you can configure to cancel them in the subsequent table elements + +The generated object will contain many "by Example" methods. If you do not want to generate these, you can configure to cancel them in the subsequent table elements ### 6. exec 'mvn mybatis-generator:generate'