├── .gitignore └── src ├── test ├── resources │ ├── scripts │ │ ├── ExampleTargetPlugin │ │ │ ├── init.sql │ │ │ ├── mybatis-generator-without-plugin.xml │ │ │ ├── mybatis-generator-without-target.xml │ │ │ └── mybatis-generator.xml │ │ ├── BugFixedTest │ │ │ ├── bug-0002.sql │ │ │ ├── pull-72.sql │ │ │ ├── issues-36.sql │ │ │ ├── issues-81.sql │ │ │ ├── issues-63.sql │ │ │ ├── bug-0001.sql │ │ │ ├── issues-70.sql │ │ │ ├── issues-76.sql │ │ │ ├── pull-103.sql │ │ │ ├── bug-0004.sql │ │ │ ├── bug-0003.sql │ │ │ ├── issues-77.sql │ │ │ ├── issues-92.sql │ │ │ ├── issues-39.sql │ │ │ ├── bug-0005.sql │ │ │ ├── issues-69.sql │ │ │ ├── issues-100.sql │ │ │ ├── issues-77.xml │ │ │ ├── pull-72.xml │ │ │ ├── issues-76.xml │ │ │ ├── issues-63.xml │ │ │ ├── issues-70-mybatis-3-5-0.xml │ │ │ ├── pull-103.xml │ │ │ ├── issues-81.xml │ │ │ ├── issues-70-mybatis-3-4-0.xml │ │ │ └── issues-39.xml │ │ ├── MapperAnnotationPlugin │ │ │ ├── init.sql │ │ │ ├── mybatis-generator.xml │ │ │ ├── mybatis-generator-with-old-repository.xml │ │ │ └── mybatis-generator-with-mapper-false.xml │ │ ├── CommentPlugin │ │ │ └── init.sql │ │ ├── ModelCloneablePlugin │ │ │ ├── init.sql │ │ │ └── mybatis-generator.xml │ │ ├── TablePrefixPlugin │ │ │ ├── init.sql │ │ │ └── mybatis-generator-with-domainObject.xml │ │ ├── TableRenamePlugin │ │ │ ├── init.sql │ │ │ ├── mybatis-generator-with-domainObject.xml │ │ │ └── mybatis-generator-with-wrong-properties.xml │ │ ├── test_init.sql │ │ ├── LimitPlugin │ │ │ ├── init.sql │ │ │ ├── mybatis-generator.xml │ │ │ ├── mybatis-generator-with-error-driver.xml │ │ │ ├── mybatis-generator-with-startPage.xml │ │ │ └── mybatis-generator-with-SelectSelectivePlugin.xml │ │ ├── SelectiveEnhancedPlugin │ │ │ ├── init.sql │ │ │ ├── mybatis-generator-without-ModelColumnPlugin.xml │ │ │ └── mybatis-generator.xml │ │ ├── ExampleEnhancedPlugin │ │ │ ├── init.sql │ │ │ ├── mybatis-generator.xml │ │ │ └── mybatis-generator-with-ModelColumnPlugin.xml │ │ ├── LombokPlugin │ │ │ ├── mybatis-generator-data.xml │ │ │ ├── mybatis-generator-with-only-keys.xml │ │ │ ├── mybatis-generator-accessors.xml │ │ │ ├── mybatis-generator-builder.xml │ │ │ ├── mybatis-generator-default.xml │ │ │ ├── mybatis-generator-constructor.xml │ │ │ ├── mybatis-generator-with-supportSuperBuilderForIdea.xml │ │ │ └── mybatis-generator.xml │ │ ├── EnumTypeStatusPlugin │ │ │ ├── init.sql │ │ │ ├── mybatis-generator.xml │ │ │ ├── mybatis-generator-with-unsupport-type.xml │ │ │ └── mybatis-generator-with-wrong-comment.xml │ │ ├── UpsertPlugin │ │ │ └── mybatis-generator-with-error-driver.xml │ │ ├── ModelColumnPlugin │ │ │ ├── init.sql │ │ │ ├── mybatis-generator.xml │ │ │ └── mybatis-generator-with-SeleciveEnhancedPlugin.xml │ │ ├── SelectOneByExamplePlugin │ │ │ ├── init.sql │ │ │ └── mybatis-generator.xml │ │ ├── BatchInsertPlugin │ │ │ ├── init.sql │ │ │ ├── mybatis-generator-without-model-column-plugin.xml │ │ │ └── mybatis-generator-with-error-driver.xml │ │ ├── LogicalDeletePlugin │ │ │ ├── mybatis-generator.xml │ │ │ ├── mybatis-generator-with-keywords.xml │ │ │ ├── mybatis-generator-with-remarks-enum.xml │ │ │ ├── mybatis-generator-with-customConstName.xml │ │ │ └── mybatis-generator-with-unconfig-logicalDeleteValue.xml │ │ ├── IncrementPlugin │ │ │ ├── init-lombok.sql │ │ │ └── mybatis-generator-without-model-column-plugin.xml │ │ ├── IncrementsPlugin │ │ │ ├── init-lombok.sql │ │ │ └── mybatis-generator-without-model-builder-plugin.xml │ │ ├── ModelBuilderPlugin │ │ │ └── mybatis-generator.xml │ │ └── TableRenameConfigurationPlugin │ │ │ ├── mybatis-generator-with-clientSuffix.xml │ │ │ ├── mybatis-generator-with-modelSuffix.xml │ │ │ └── mybatis-generator-with-exampleSuffix.xml │ └── db.properties └── java │ └── com │ └── itfsw │ └── mybatis │ └── generator │ └── plugins │ ├── tools │ └── IBeforeCallback.java │ ├── DBHelperTest.java │ └── ModelCloneablePluginTest.java └── main └── java └── com └── itfsw └── mybatis └── generator └── plugins ├── utils ├── EnumModelType.java ├── hook │ ├── ITableConfigurationHook.java │ ├── ISelectSelectivePluginHook.java │ ├── IModelColumnPluginHook.java │ ├── IIncrementsPluginHook.java │ ├── ILombokPluginHook.java │ ├── IOptimisticLockerPluginHook.java │ ├── IIncrementPluginHook.java │ ├── IModelBuilderPluginHook.java │ └── ISelectOneByExamplePluginHook.java ├── enhanced │ └── SpecTypeArgumentsFullyQualifiedJavaType.java └── BeanUtils.java └── CommentPlugin.java /.gitignore: -------------------------------------------------------------------------------- 1 | *.class 2 | 3 | # Mobile Tools for Java (J2ME) 4 | .mtj.tmp/ 5 | 6 | # Package Files # 7 | *.jar 8 | *.war 9 | *.ear 10 | 11 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 12 | hs_err_pid* 13 | .idea/ 14 | mybatis-generator-plugin.iml 15 | target/ 16 | -------------------------------------------------------------------------------- /src/test/resources/scripts/ExampleTargetPlugin/init.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat MySQL Data Transfer 3 | 4 | Source Server : localhost 5 | Source Server Version : 50617 6 | Source Host : localhost:3306 7 | Source Database : mybatis-generator-plugin 8 | 9 | Target Server Type : MYSQL 10 | Target Server Version : 50617 11 | File Encoding : 65001 12 | 13 | Date: 2017-06-26 17:30:13 14 | */ 15 | 16 | SET FOREIGN_KEY_CHECKS=0; 17 | 18 | -- ---------------------------- 19 | -- Table structure for tb 20 | -- ---------------------------- 21 | DROP TABLE IF EXISTS `tb`; 22 | CREATE TABLE `tb` ( 23 | `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '注释1', 24 | `field1` varchar(255) DEFAULT NULL COMMENT '注释2', 25 | PRIMARY KEY (`id`) 26 | ) ENGINE=MyISAM; -------------------------------------------------------------------------------- /src/test/resources/scripts/BugFixedTest/bug-0002.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat MySQL Data Transfer 3 | 4 | Source Server : localhost 5 | Source Server Version : 50617 6 | Source Host : localhost:3306 7 | Source Database : mybatis-generator-plugin 8 | 9 | Target Server Type : MYSQL 10 | Target Server Version : 50617 11 | File Encoding : 65001 12 | 13 | Date: 2017-06-27 11:17:08 14 | */ 15 | 16 | SET FOREIGN_KEY_CHECKS=0; 17 | 18 | -- ---------------------------- 19 | -- Table structure for tb 20 | -- ---------------------------- 21 | DROP TABLE IF EXISTS `tb`; 22 | CREATE TABLE `tb` ( 23 | `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '注释1', 24 | `field1` varchar(255) DEFAULT NULL, 25 | PRIMARY KEY (`id`) 26 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -------------------------------------------------------------------------------- /src/test/resources/scripts/BugFixedTest/pull-72.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat MySQL Data Transfer 3 | 4 | Source Server : localhost 5 | Source Server Version : 50617 6 | Source Host : localhost:3306 7 | Source Database : mybatis-generator-plugin 8 | 9 | Target Server Type : MYSQL 10 | Target Server Version : 50617 11 | File Encoding : 65001 12 | 13 | Date: 2017-06-27 11:17:08 14 | */ 15 | 16 | SET FOREIGN_KEY_CHECKS=0; 17 | 18 | -- ---------------------------- 19 | -- Table structure for tb 20 | -- ---------------------------- 21 | DROP TABLE IF EXISTS `tb`; 22 | CREATE TABLE `tb` ( 23 | `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '注释1', 24 | `type` smallint(3) DEFAULT NULL COMMENT '注释[success(0):成功, fail(-1):失败]', 25 | PRIMARY KEY (`id`) 26 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -------------------------------------------------------------------------------- /src/test/resources/scripts/BugFixedTest/issues-36.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat MySQL Data Transfer 3 | 4 | Source Server : localhost 5 | Source Server Version : 50617 6 | Source Host : localhost:3306 7 | Source Database : mybatis-generator-plugin 8 | 9 | Target Server Type : MYSQL 10 | Target Server Version : 50617 11 | File Encoding : 65001 12 | 13 | Date: 2017-06-27 11:17:08 14 | */ 15 | 16 | SET FOREIGN_KEY_CHECKS=0; 17 | 18 | -- ---------------------------- 19 | -- Table structure for tb 20 | -- ---------------------------- 21 | DROP TABLE IF EXISTS `tb`; 22 | CREATE TABLE `tb` ( 23 | `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '注释1', 24 | `field1` varchar(255) DEFAULT NULL COMMENT '注释2', 25 | `t_date` date DEFAULT NULL, 26 | PRIMARY KEY (`id`) 27 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -------------------------------------------------------------------------------- /src/test/resources/scripts/BugFixedTest/issues-81.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat MySQL Data Transfer 3 | 4 | Source Server : localhost 5 | Source Server Version : 50617 6 | Source Host : localhost:3306 7 | Source Database : mybatis-generator-plugin 8 | 9 | Target Server Type : MYSQL 10 | Target Server Version : 50617 11 | File Encoding : 65001 12 | 13 | Date: 2017-06-27 11:17:08 14 | */ 15 | 16 | SET FOREIGN_KEY_CHECKS=0; 17 | 18 | -- ---------------------------- 19 | -- Table structure for tb 20 | -- ---------------------------- 21 | DROP TABLE IF EXISTS `tb`; 22 | CREATE TABLE `tb` ( 23 | `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '注释1', 24 | `field1` varchar(255) DEFAULT NULL COMMENT '注释2', 25 | `vs` int DEFAULT NULL, 26 | PRIMARY KEY (`id`) 27 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; 28 | -------------------------------------------------------------------------------- /src/test/resources/scripts/MapperAnnotationPlugin/init.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat MySQL Data Transfer 3 | 4 | Source Server : localhost 5 | Source Server Version : 50617 6 | Source Host : localhost:3306 7 | Source Database : mybatis-generator-plugin 8 | 9 | Target Server Type : MYSQL 10 | Target Server Version : 50617 11 | File Encoding : 65001 12 | 13 | Date: 2017-07-03 17:34:11 14 | */ 15 | 16 | SET FOREIGN_KEY_CHECKS=0; 17 | 18 | -- ---------------------------- 19 | -- Table structure for tb 20 | -- ---------------------------- 21 | DROP TABLE IF EXISTS `tb`; 22 | CREATE TABLE `tb` ( 23 | `id` bigint(20) NOT NULL COMMENT '注释1', 24 | `field1` varchar(255) DEFAULT NULL COMMENT '注释2', 25 | `field2` int(11) DEFAULT NULL, 26 | PRIMARY KEY (`id`) 27 | ) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; -------------------------------------------------------------------------------- /src/test/resources/scripts/BugFixedTest/issues-63.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat MySQL Data Transfer 3 | 4 | Source Server : localhost 5 | Source Server Version : 50617 6 | Source Host : localhost:3306 7 | Source Database : mybatis-generator-plugin 8 | 9 | Target Server Type : MYSQL 10 | Target Server Version : 50617 11 | File Encoding : 65001 12 | 13 | Date: 2017-06-27 11:17:08 14 | */ 15 | 16 | SET FOREIGN_KEY_CHECKS=0; 17 | 18 | -- ---------------------------- 19 | -- Table structure for tb 20 | -- ---------------------------- 21 | DROP TABLE IF EXISTS `t_repay_detail`; 22 | CREATE TABLE `t_repay_detail` ( 23 | `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '注释1', 24 | `field1` varchar(255) DEFAULT NULL COMMENT '注释2', 25 | `vs` int DEFAULT NULL, 26 | PRIMARY KEY (`id`) 27 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; 28 | -------------------------------------------------------------------------------- /src/test/resources/scripts/CommentPlugin/init.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat MySQL Data Transfer 3 | 4 | Source Server : localhost 5 | Source Server Version : 50617 6 | Source Host : localhost:3306 7 | Source Database : mybatis-generator-plugin 8 | 9 | Target Server Type : MYSQL 10 | Target Server Version : 50617 11 | File Encoding : 65001 12 | 13 | Date: 2017-06-26 17:30:13 14 | */ 15 | 16 | SET FOREIGN_KEY_CHECKS=0; 17 | 18 | -- ---------------------------- 19 | -- Table structure for tb 20 | -- ---------------------------- 21 | DROP TABLE IF EXISTS `tb`; 22 | CREATE TABLE `tb` ( 23 | `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '注释1', 24 | `field1` varchar(255) DEFAULT NULL COMMENT '注释2', 25 | PRIMARY KEY (`id`) 26 | ); 27 | 28 | -- ---------------------------- 29 | -- Records of tb 30 | -- ---------------------------- -------------------------------------------------------------------------------- /src/test/resources/db.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | driver=com.mysql.cj.jdbc.Driver 18 | url=jdbc:mysql://localhost:3306/mybatis-generator-plugin?characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true 19 | username=root 20 | password=root -------------------------------------------------------------------------------- /src/test/resources/scripts/BugFixedTest/bug-0001.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat MySQL Data Transfer 3 | 4 | Source Server : localhost 5 | Source Server Version : 50617 6 | Source Host : localhost:3306 7 | Source Database : mybatis-generator-plugin 8 | 9 | Target Server Type : MYSQL 10 | Target Server Version : 50617 11 | File Encoding : 65001 12 | 13 | Date: 2017-06-27 11:17:08 14 | */ 15 | 16 | SET FOREIGN_KEY_CHECKS=0; 17 | 18 | -- ---------------------------- 19 | -- Table structure for tb 20 | -- ---------------------------- 21 | DROP TABLE IF EXISTS `tb`; 22 | CREATE TABLE `tb` ( 23 | `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '注释1', 24 | `field1` varchar(255) DEFAULT NULL COMMENT '注释2', 25 | `field2` int DEFAULT NULL, 26 | `table` varchar(255) DEFAULT NULL, 27 | PRIMARY KEY (`id`) 28 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -------------------------------------------------------------------------------- /src/test/resources/scripts/ModelCloneablePlugin/init.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat MySQL Data Transfer 3 | 4 | Source Server : localhost 5 | Source Server Version : 50617 6 | Source Host : localhost:3306 7 | Source Database : mybatis-generator-plugin 8 | 9 | Target Server Type : MYSQL 10 | Target Server Version : 50617 11 | File Encoding : 65001 12 | 13 | Date: 2017-07-03 17:34:11 14 | */ 15 | 16 | SET FOREIGN_KEY_CHECKS=0; 17 | 18 | -- ---------------------------- 19 | -- Table structure for tb 20 | -- ---------------------------- 21 | DROP TABLE IF EXISTS `tb`; 22 | CREATE TABLE `tb` ( 23 | `id` bigint(20) NOT NULL COMMENT '注释1', 24 | `key1` varchar(255) NOT NULL, 25 | `field1` varchar(255) DEFAULT NULL COMMENT '注释2', 26 | `field2` int(11) DEFAULT NULL, 27 | PRIMARY KEY (`id`, `key1`) 28 | ) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; -------------------------------------------------------------------------------- /src/test/resources/scripts/BugFixedTest/issues-70.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat MySQL Data Transfer 3 | 4 | Source Server : localhost 5 | Source Server Version : 50617 6 | Source Host : localhost:3306 7 | Source Database : mybatis-generator-plugin 8 | 9 | Target Server Type : MYSQL 10 | Target Server Version : 50617 11 | File Encoding : 65001 12 | 13 | Date: 2017-06-27 11:17:08 14 | */ 15 | 16 | SET FOREIGN_KEY_CHECKS=0; 17 | 18 | -- ---------------------------- 19 | -- Table structure for tb 20 | -- ---------------------------- 21 | DROP TABLE IF EXISTS `tb`; 22 | CREATE TABLE `tb` ( 23 | `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '注释1', 24 | `field1` varchar(255) DEFAULT NULL COMMENT '注释2', 25 | `field2` int DEFAULT NULL, 26 | PRIMARY KEY (`id`) 27 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; 28 | 29 | -- ---------------------------- 30 | -- Records of tb 31 | -- ---------------------------- -------------------------------------------------------------------------------- /src/test/resources/scripts/BugFixedTest/issues-76.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat MySQL Data Transfer 3 | 4 | Source Server : localhost 5 | Source Server Version : 50617 6 | Source Host : localhost:3306 7 | Source Database : mybatis-generator-plugin 8 | 9 | Target Server Type : MYSQL 10 | Target Server Version : 50617 11 | File Encoding : 65001 12 | 13 | Date: 2017-06-27 11:17:08 14 | */ 15 | 16 | SET FOREIGN_KEY_CHECKS=0; 17 | 18 | -- ---------------------------- 19 | -- Table structure for tb 20 | -- ---------------------------- 21 | DROP TABLE IF EXISTS `tb`; 22 | CREATE TABLE `tb` ( 23 | `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '注释1', 24 | `field1` varchar(255) DEFAULT NULL COMMENT '注释2', 25 | `field2` int DEFAULT NULL, 26 | PRIMARY KEY (`id`) 27 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; 28 | 29 | -- ---------------------------- 30 | -- Records of tb 31 | -- ---------------------------- -------------------------------------------------------------------------------- /src/test/resources/scripts/TablePrefixPlugin/init.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat MySQL Data Transfer 3 | 4 | Source Server : localhost 5 | Source Server Version : 50617 6 | Source Host : localhost:3306 7 | Source Database : mybatis-generator-plugin 8 | 9 | Target Server Type : MYSQL 10 | Target Server Version : 50617 11 | File Encoding : 65001 12 | 13 | Date: 2017-06-26 17:30:13 14 | */ 15 | 16 | SET FOREIGN_KEY_CHECKS=0; 17 | 18 | -- ---------------------------- 19 | -- Table structure for tb1 20 | -- ---------------------------- 21 | DROP TABLE IF EXISTS `tb1`; 22 | CREATE TABLE `tb1` ( 23 | `id` bigint(20) NOT NULL AUTO_INCREMENT, 24 | PRIMARY KEY (`id`) 25 | ); 26 | 27 | -- ---------------------------- 28 | -- Table structure for tb2 29 | -- ---------------------------- 30 | DROP TABLE IF EXISTS `tb2`; 31 | CREATE TABLE `tb2` ( 32 | `id` bigint(20) NOT NULL AUTO_INCREMENT, 33 | PRIMARY KEY (`id`) 34 | ); -------------------------------------------------------------------------------- /src/test/resources/scripts/TableRenamePlugin/init.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat MySQL Data Transfer 3 | 4 | Source Server : localhost 5 | Source Server Version : 50617 6 | Source Host : localhost:3306 7 | Source Database : mybatis-generator-plugin 8 | 9 | Target Server Type : MYSQL 10 | Target Server Version : 50617 11 | File Encoding : 65001 12 | 13 | Date: 2017-06-26 17:30:13 14 | */ 15 | 16 | SET FOREIGN_KEY_CHECKS=0; 17 | 18 | -- ---------------------------- 19 | -- Table structure for tb1 20 | -- ---------------------------- 21 | DROP TABLE IF EXISTS `tb1`; 22 | CREATE TABLE `tb1` ( 23 | `id` bigint(20) NOT NULL AUTO_INCREMENT, 24 | PRIMARY KEY (`id`) 25 | ); 26 | 27 | -- ---------------------------- 28 | -- Table structure for tb2 29 | -- ---------------------------- 30 | DROP TABLE IF EXISTS `tb2`; 31 | CREATE TABLE `tb2` ( 32 | `id` bigint(20) NOT NULL AUTO_INCREMENT, 33 | PRIMARY KEY (`id`) 34 | ); -------------------------------------------------------------------------------- /src/test/resources/scripts/BugFixedTest/pull-103.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat MySQL Data Transfer 3 | 4 | Source Server : localhost 5 | Source Server Version : 50617 6 | Source Host : localhost:3306 7 | Source Database : mybatis-generator-plugin 8 | 9 | Target Server Type : MYSQL 10 | Target Server Version : 50617 11 | File Encoding : 65001 12 | 13 | Date: 2017-06-27 11:17:08 14 | */ 15 | 16 | SET FOREIGN_KEY_CHECKS=0; 17 | 18 | -- ---------------------------- 19 | -- Table structure for tb 20 | -- ---------------------------- 21 | DROP TABLE IF EXISTS `tb`; 22 | CREATE TABLE `tb` ( 23 | `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '注释1', 24 | `type` smallint(3) DEFAULT NULL COMMENT '注释[success(0):成功, fail(-1):失败]', 25 | PRIMARY KEY (`id`) 26 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; 27 | 28 | -- ---------------------------- 29 | -- Records of tb 30 | -- ---------------------------- 31 | INSERT INTO `tb` VALUES (1, 0); -------------------------------------------------------------------------------- /src/test/resources/scripts/BugFixedTest/bug-0004.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat MySQL Data Transfer 3 | 4 | Source Server : localhost 5 | Source Server Version : 50617 6 | Source Host : localhost:3306 7 | Source Database : mybatis-generator-plugin 8 | 9 | Target Server Type : MYSQL 10 | Target Server Version : 50617 11 | File Encoding : 65001 12 | 13 | Date: 2017-07-05 17:21:41 14 | */ 15 | 16 | SET FOREIGN_KEY_CHECKS=0; 17 | 18 | -- ---------------------------- 19 | -- Table structure for tb 20 | -- ---------------------------- 21 | DROP TABLE IF EXISTS `tb_test`; 22 | CREATE TABLE `tb_test` ( 23 | `id` bigint(20) NOT NULL COMMENT '注释1', 24 | `field1` varchar(255) DEFAULT NULL COMMENT '注释2', 25 | `inc_f2` bigint(20) DEFAULT '0', 26 | `inc_f3` bigint(20) DEFAULT '0', 27 | PRIMARY KEY (`id`) 28 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; 29 | 30 | -- ---------------------------- 31 | -- Records of tb_test 32 | -- ---------------------------- -------------------------------------------------------------------------------- /src/test/resources/scripts/BugFixedTest/bug-0003.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat MySQL Data Transfer 3 | 4 | Source Server : localhost 5 | Source Server Version : 50617 6 | Source Host : localhost:3306 7 | Source Database : mybatis-generator-plugin 8 | 9 | Target Server Type : MYSQL 10 | Target Server Version : 50617 11 | File Encoding : 65001 12 | 13 | Date: 2017-07-05 17:21:41 14 | */ 15 | 16 | SET FOREIGN_KEY_CHECKS=0; 17 | 18 | -- ---------------------------- 19 | -- Table structure for tb 20 | -- ---------------------------- 21 | DROP TABLE IF EXISTS `tb`; 22 | CREATE TABLE `tb` ( 23 | `id` bigint(20) NOT NULL COMMENT '注释1', 24 | `field1` varchar(255) DEFAULT NULL COMMENT '注释2', 25 | `inc_f2` bigint(20) DEFAULT '0', 26 | `inc_f3` bigint(20) DEFAULT '0', 27 | PRIMARY KEY (`id`) 28 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; 29 | 30 | -- ---------------------------- 31 | -- Records of tb 32 | -- ---------------------------- 33 | INSERT INTO `tb` VALUES ('1', '2019-01', '2', '0'); -------------------------------------------------------------------------------- /src/test/resources/scripts/test_init.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat MySQL Data Transfer 3 | 4 | Source Server : localhost 5 | Source Server Version : 50617 6 | Source Host : localhost:3306 7 | Source Database : mybatis-generator-plugin 8 | 9 | Target Server Type : MYSQL 10 | Target Server Version : 50617 11 | File Encoding : 65001 12 | 13 | Date: 2017-06-26 17:30:13 14 | */ 15 | 16 | SET FOREIGN_KEY_CHECKS=0; 17 | 18 | -- ---------------------------- 19 | -- Table structure for tb 20 | -- ---------------------------- 21 | DROP TABLE IF EXISTS `tb`; 22 | CREATE TABLE `tb` ( 23 | `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '注释1', 24 | `field1` varchar(255) DEFAULT NULL COMMENT '注释2', 25 | PRIMARY KEY (`id`) 26 | ); 27 | 28 | -- ---------------------------- 29 | -- Records of tb 30 | -- ---------------------------- 31 | INSERT INTO `tb` VALUES ('1', 'f1'); 32 | INSERT INTO `tb` VALUES ('2', 'f2'); 33 | INSERT INTO `tb` VALUES ('3', 'f3'); 34 | INSERT INTO `tb` VALUES ('4', 'f4'); 35 | -------------------------------------------------------------------------------- /src/test/resources/scripts/BugFixedTest/issues-77.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat MySQL Data Transfer 3 | 4 | Source Server : localhost 5 | Source Server Version : 50617 6 | Source Host : localhost:3306 7 | Source Database : mybatis-generator-plugin 8 | 9 | Target Server Type : MYSQL 10 | Target Server Version : 50617 11 | File Encoding : 65001 12 | 13 | Date: 2017-07-03 17:34:11 14 | */ 15 | 16 | SET FOREIGN_KEY_CHECKS=0; 17 | 18 | -- ---------------------------- 19 | -- Table structure for tb 20 | -- ---------------------------- 21 | DROP TABLE IF EXISTS `tb`; 22 | CREATE TABLE `tb` ( 23 | `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '注释1', 24 | `field1` varchar(255) DEFAULT NULL COMMENT '注释2', 25 | `field2` int(11) DEFAULT NULL, 26 | PRIMARY KEY (`id`) 27 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; 28 | 29 | -- ---------------------------- 30 | -- Records of tb 31 | -- ---------------------------- 32 | INSERT INTO `tb` VALUES ('1', 'fd1', null); 33 | INSERT INTO `tb` VALUES ('2', null, '2'); 34 | INSERT INTO `tb` VALUES ('3', 'fd3', '3'); -------------------------------------------------------------------------------- /src/test/resources/scripts/BugFixedTest/issues-92.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat MySQL Data Transfer 3 | 4 | Source Server : localhost 5 | Source Server Version : 50617 6 | Source Host : localhost:3306 7 | Source Database : mybatis-generator-plugin 8 | 9 | Target Server Type : MYSQL 10 | Target Server Version : 50617 11 | File Encoding : 65001 12 | 13 | Date: 2017-06-27 11:17:08 14 | */ 15 | 16 | SET FOREIGN_KEY_CHECKS=0; 17 | 18 | -- ---------------------------- 19 | -- Table structure for tb 20 | -- ---------------------------- 21 | DROP TABLE IF EXISTS `tb`; 22 | CREATE TABLE `tb` ( 23 | `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '注释1', 24 | `field1` varchar(255) DEFAULT NULL COMMENT '注释2', 25 | `my_name` varchar(255) DEFAULT NULL, 26 | PRIMARY KEY (`id`) 27 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; 28 | 29 | -- ---------------------------- 30 | -- Records of tb 31 | -- ---------------------------- 32 | INSERT INTO `tb` VALUES ('1', 'fd1', '1'); 33 | INSERT INTO `tb` VALUES ('2', null, '2'); 34 | INSERT INTO `tb` VALUES ('3', 'fd3', '3'); -------------------------------------------------------------------------------- /src/test/resources/scripts/BugFixedTest/issues-39.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat MySQL Data Transfer 3 | 4 | Source Server : localhost 5 | Source Server Version : 50617 6 | Source Host : localhost:3306 7 | Source Database : mybatis-generator-plugin 8 | 9 | Target Server Type : MYSQL 10 | Target Server Version : 50617 11 | File Encoding : 65001 12 | 13 | Date: 2017-06-27 11:17:08 14 | */ 15 | 16 | SET FOREIGN_KEY_CHECKS=0; 17 | 18 | -- ---------------------------- 19 | -- Table structure for tb 20 | -- ---------------------------- 21 | DROP TABLE IF EXISTS `tb`; 22 | CREATE TABLE `tb` ( 23 | `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '注释1', 24 | `field1` varchar(255) DEFAULT NULL COMMENT '注释2', 25 | `vs` int DEFAULT NULL, 26 | PRIMARY KEY (`id`) 27 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; 28 | 29 | -- ---------------------------- 30 | -- Table structure for tb1 31 | -- ---------------------------- 32 | DROP TABLE IF EXISTS `tb1`; 33 | CREATE TABLE `tb1` ( 34 | `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '注释1', 35 | `field1` varchar(255) DEFAULT NULL COMMENT '注释2', 36 | `vs` int DEFAULT NULL, 37 | PRIMARY KEY (`id`) 38 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -------------------------------------------------------------------------------- /src/main/java/com/itfsw/mybatis/generator/plugins/utils/EnumModelType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.itfsw.mybatis.generator.plugins.utils; 18 | 19 | /** 20 | * --------------------------------------------------------------------------- 21 | * 22 | * --------------------------------------------------------------------------- 23 | * @author: hewei 24 | * @time:2019/7/12 10:13 25 | * --------------------------------------------------------------------------- 26 | */ 27 | public enum EnumModelType { 28 | MODEL_PRIMARY_KEY, MODEL_BASE_RECORD, MODEL_RECORD_WITH_BLOBS 29 | } 30 | -------------------------------------------------------------------------------- /src/test/java/com/itfsw/mybatis/generator/plugins/tools/IBeforeCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.itfsw.mybatis.generator.plugins.tools; 18 | 19 | /** 20 | * --------------------------------------------------------------------------- 21 | * 回调之前执行 22 | * --------------------------------------------------------------------------- 23 | * @author: hewei 24 | * @time:2018/4/25 18:42 25 | * --------------------------------------------------------------------------- 26 | */ 27 | public interface IBeforeCallback { 28 | /** 29 | * 执行 30 | */ 31 | void run() throws Exception; 32 | } 33 | -------------------------------------------------------------------------------- /src/test/resources/scripts/BugFixedTest/bug-0005.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat MySQL Data Transfer 3 | 4 | Source Server : localhost 5 | Source Server Version : 50617 6 | Source Host : localhost:3306 7 | Source Database : mybatis-generator-plugin 8 | 9 | Target Server Type : MYSQL 10 | Target Server Version : 50617 11 | File Encoding : 65001 12 | 13 | Date: 2017-07-05 17:21:41 14 | */ 15 | 16 | SET FOREIGN_KEY_CHECKS=0; 17 | 18 | -- ---------------------------- 19 | -- Table structure for tb 20 | -- ---------------------------- 21 | DROP TABLE IF EXISTS `tb`; 22 | CREATE TABLE `tb` ( 23 | `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '注释1', 24 | `field1` varchar(255) DEFAULT NULL COMMENT '注释2', 25 | `version` bigint(20) NOT NULL DEFAULT '0', 26 | `inc_f2` bigint(20) DEFAULT '0', 27 | `inc_f3` bigint(20) DEFAULT '0', 28 | PRIMARY KEY (`id`) 29 | ) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; 30 | 31 | -- ---------------------------- 32 | -- Records of tb 33 | -- ---------------------------- 34 | INSERT INTO `tb` VALUES ('1', 'fd1', '0', '2', '0'); 35 | INSERT INTO `tb` VALUES ('2', 'fd2', '1', '2', '3'); 36 | INSERT INTO `tb` VALUES ('3', null, '3', '2', '1'); 37 | INSERT INTO `tb` VALUES ('4', 'fd3', '1', '1', '1'); -------------------------------------------------------------------------------- /src/test/resources/scripts/BugFixedTest/issues-69.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat MySQL Data Transfer 3 | 4 | Source Server : localhost 5 | Source Server Version : 50617 6 | Source Host : localhost:3306 7 | Source Database : mybatis-generator-plugin 8 | 9 | Target Server Type : MYSQL 10 | Target Server Version : 50617 11 | File Encoding : 65001 12 | 13 | Date: 2017-07-05 17:21:41 14 | */ 15 | 16 | SET FOREIGN_KEY_CHECKS=0; 17 | 18 | -- ---------------------------- 19 | -- Table structure for tb 20 | -- ---------------------------- 21 | DROP TABLE IF EXISTS `tb`; 22 | CREATE TABLE `tb` ( 23 | `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '注释1', 24 | `field1` varchar(255) DEFAULT NULL COMMENT '注释2', 25 | `version` bigint(20) NOT NULL DEFAULT '0', 26 | `inc_f2` bigint(20) DEFAULT '0', 27 | `inc_f3` bigint(20) DEFAULT '0', 28 | PRIMARY KEY (`id`) 29 | ) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; 30 | 31 | -- ---------------------------- 32 | -- Records of tb 33 | -- ---------------------------- 34 | INSERT INTO `tb` VALUES ('1', 'fd1', '0', '2', '0'); 35 | INSERT INTO `tb` VALUES ('2', 'fd2', '1', '2', '3'); 36 | INSERT INTO `tb` VALUES ('3', null, '3', '2', '1'); 37 | INSERT INTO `tb` VALUES ('4', 'fd3', '1', '1', '1'); -------------------------------------------------------------------------------- /src/test/resources/scripts/LimitPlugin/init.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat MySQL Data Transfer 3 | 4 | Source Server : localhost 5 | Source Server Version : 50617 6 | Source Host : localhost:3306 7 | Source Database : mybatis-generator-plugin 8 | 9 | Target Server Type : MYSQL 10 | Target Server Version : 50617 11 | File Encoding : 65001 12 | 13 | Date: 2017-06-26 17:30:13 14 | */ 15 | 16 | SET FOREIGN_KEY_CHECKS=0; 17 | 18 | -- ---------------------------- 19 | -- Table structure for tb 20 | -- ---------------------------- 21 | DROP TABLE IF EXISTS `tb`; 22 | CREATE TABLE `tb` ( 23 | `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '注释1', 24 | `field1` varchar(255) DEFAULT NULL COMMENT '注释2', 25 | PRIMARY KEY (`id`) 26 | ); 27 | 28 | -- ---------------------------- 29 | -- Records of tb 30 | -- ---------------------------- 31 | INSERT INTO `tb` VALUES ('1', 'f1'); 32 | INSERT INTO `tb` VALUES ('2', 'f2'); 33 | INSERT INTO `tb` VALUES ('3', 'f3'); 34 | INSERT INTO `tb` VALUES ('4', 'f4'); 35 | INSERT INTO `tb` VALUES ('5', 'f5'); 36 | INSERT INTO `tb` VALUES ('6', 'f6'); 37 | INSERT INTO `tb` VALUES ('7', 'f7'); 38 | INSERT INTO `tb` VALUES ('8', 'f8'); 39 | INSERT INTO `tb` VALUES ('9', 'f9'); 40 | INSERT INTO `tb` VALUES ('10', 'f10'); -------------------------------------------------------------------------------- /src/test/resources/scripts/SelectiveEnhancedPlugin/init.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat MySQL Data Transfer 3 | 4 | Source Server : localhost 5 | Source Server Version : 50617 6 | Source Host : localhost:3306 7 | Source Database : mybatis-generator-plugin 8 | 9 | Target Server Type : MYSQL 10 | Target Server Version : 50617 11 | File Encoding : 65001 12 | 13 | Date: 2017-07-05 17:21:41 14 | */ 15 | 16 | SET FOREIGN_KEY_CHECKS=0; 17 | 18 | -- ---------------------------- 19 | -- Table structure for tb 20 | -- ---------------------------- 21 | DROP TABLE IF EXISTS `tb`; 22 | CREATE TABLE `tb` ( 23 | `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '注释1', 24 | `field_1` varchar(255) DEFAULT NULL COMMENT '注释2', 25 | `inc_f1` bigint(20) NOT NULL DEFAULT '0', 26 | `inc_f2` bigint(20) NOT NULL DEFAULT '0', 27 | `inc_f3` bigint(20) NOT NULL DEFAULT '0', 28 | PRIMARY KEY (`id`) 29 | ) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; 30 | 31 | -- ---------------------------- 32 | -- Records of tb 33 | -- ---------------------------- 34 | INSERT INTO `tb` VALUES ('1', 'fd1', '0', '0', '0'); 35 | INSERT INTO `tb` VALUES ('2', 'fd2', '1', '2', '3'); 36 | INSERT INTO `tb` VALUES ('3', null, '3', '2', '1'); 37 | INSERT INTO `tb` VALUES ('4', 'fd3', '1', '1', '1'); -------------------------------------------------------------------------------- /src/main/java/com/itfsw/mybatis/generator/plugins/utils/hook/ITableConfigurationHook.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.itfsw.mybatis.generator.plugins.utils.hook; 18 | 19 | import org.mybatis.generator.api.IntrospectedTable; 20 | 21 | /** 22 | * --------------------------------------------------------------------------- 23 | * 24 | * --------------------------------------------------------------------------- 25 | * @author: hewei 26 | * @time:2018/5/21 11:24 27 | * --------------------------------------------------------------------------- 28 | */ 29 | public interface ITableConfigurationHook { 30 | /** 31 | * 表配置 32 | * @param introspectedTable 33 | */ 34 | void tableConfiguration(IntrospectedTable introspectedTable); 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/itfsw/mybatis/generator/plugins/utils/hook/ISelectSelectivePluginHook.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.itfsw.mybatis.generator.plugins.utils.hook; 18 | 19 | import org.mybatis.generator.api.IntrospectedTable; 20 | import org.mybatis.generator.api.dom.xml.Document; 21 | import org.mybatis.generator.api.dom.xml.XmlElement; 22 | 23 | /** 24 | * --------------------------------------------------------------------------- 25 | * 26 | * --------------------------------------------------------------------------- 27 | * @author: hewei 28 | * @time:2018/12/18 14:57 29 | * --------------------------------------------------------------------------- 30 | */ 31 | public interface ISelectSelectivePluginHook { 32 | 33 | boolean sqlMapSelectByExampleSelectiveElementGenerated(Document document, XmlElement element, IntrospectedTable introspectedTable); 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/itfsw/mybatis/generator/plugins/CommentPlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.itfsw.mybatis.generator.plugins; 18 | 19 | import com.itfsw.mybatis.generator.plugins.utils.BasePlugin; 20 | 21 | import java.util.Properties; 22 | 23 | /** 24 | * --------------------------------------------------------------------------- 25 | * 评论插件 26 | * --------------------------------------------------------------------------- 27 | * @author: hewei 28 | * @time:2017/6/8 11:21 29 | * --------------------------------------------------------------------------- 30 | */ 31 | public class CommentPlugin extends BasePlugin { 32 | /** 33 | * 模板 property 34 | */ 35 | public static final String PRO_TEMPLATE = "template"; 36 | 37 | /** 38 | * 插件具体实现查看BasePlugin 39 | * @param properties 40 | */ 41 | @Override 42 | public void setProperties(Properties properties) { 43 | super.setProperties(properties); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/itfsw/mybatis/generator/plugins/utils/hook/IModelColumnPluginHook.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.itfsw.mybatis.generator.plugins.utils.hook; 18 | 19 | import org.mybatis.generator.api.IntrospectedTable; 20 | import org.mybatis.generator.api.dom.java.InnerEnum; 21 | import org.mybatis.generator.api.dom.java.TopLevelClass; 22 | 23 | /** 24 | * --------------------------------------------------------------------------- 25 | * 26 | * --------------------------------------------------------------------------- 27 | * @author: hewei 28 | * @time:2019/7/5 14:17 29 | * --------------------------------------------------------------------------- 30 | */ 31 | public interface IModelColumnPluginHook { 32 | /** 33 | * Model Column 枚举生成 34 | * @param innerEnum 35 | * @param topLevelClass 36 | * @param introspectedTable 37 | * @return 38 | */ 39 | boolean modelColumnEnumGenerated(InnerEnum innerEnum, TopLevelClass topLevelClass, IntrospectedTable introspectedTable); 40 | } 41 | -------------------------------------------------------------------------------- /src/test/resources/scripts/BugFixedTest/issues-100.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat MySQL Data Transfer 3 | 4 | Source Server : localhost 5 | Source Server Version : 50617 6 | Source Host : localhost:3306 7 | Source Database : mybatis-generator-plugin 8 | 9 | Target Server Type : MYSQL 10 | Target Server Version : 50617 11 | File Encoding : 65001 12 | 13 | Date: 2017-06-27 11:17:08 14 | */ 15 | 16 | SET FOREIGN_KEY_CHECKS=0; 17 | 18 | -- ---------------------------- 19 | -- Table structure for tb 20 | -- ---------------------------- 21 | DROP TABLE IF EXISTS `sys_company`; 22 | create table sys_company 23 | ( 24 | company_id int auto_increment comment '公司id' 25 | primary key, 26 | company_linkman varchar(64) null comment '联系人名称', 27 | company_name varchar(128) null comment '名称', 28 | company_mobile varchar(11) null comment '手机', 29 | company_email varchar(128) null comment '邮箱', 30 | company_intro varchar(512) null comment '简介', 31 | company_logo varchar(128) null comment 'logo', 32 | company_identity_pic varchar(128) null comment '身份证照片', 33 | company_work_type varchar(45) null comment '工作性质', 34 | company_business_pic varchar(128) null comment '营业执照', 35 | company_status varchar(32) null comment '状态[disable(disable):禁用,deleted(deleted):删除]', 36 | company_create_time timestamp default CURRENT_TIMESTAMP null comment '创建时间', 37 | company_update_time timestamp null comment '更新时间', 38 | column_14 int null 39 | )ENGINE=MyISAM DEFAULT CHARSET=utf8; -------------------------------------------------------------------------------- /src/main/java/com/itfsw/mybatis/generator/plugins/utils/enhanced/SpecTypeArgumentsFullyQualifiedJavaType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.itfsw.mybatis.generator.plugins.utils.enhanced; 18 | 19 | import org.mybatis.generator.api.dom.java.FullyQualifiedJavaType; 20 | 21 | /** 22 | * --------------------------------------------------------------------------- 23 | * 24 | * --------------------------------------------------------------------------- 25 | * @author: hewei 26 | * @time:2018/11/2 18:21 27 | * --------------------------------------------------------------------------- 28 | */ 29 | public class SpecTypeArgumentsFullyQualifiedJavaType extends FullyQualifiedJavaType { 30 | private String fullTypeSpecification; 31 | /** 32 | * Use this constructor to construct a generic type with the specified type parameters. 33 | * @param fullTypeSpecification the full type specification 34 | */ 35 | public SpecTypeArgumentsFullyQualifiedJavaType(String fullTypeSpecification) { 36 | super(""); 37 | 38 | this.fullTypeSpecification = fullTypeSpecification; 39 | } 40 | 41 | @Override 42 | public String getShortName() { 43 | return this.fullTypeSpecification.substring(1, this.fullTypeSpecification.length() - 1); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/itfsw/mybatis/generator/plugins/utils/hook/IIncrementsPluginHook.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.itfsw.mybatis.generator.plugins.utils.hook; 18 | 19 | import org.mybatis.generator.api.IntrospectedColumn; 20 | import org.mybatis.generator.api.dom.xml.Element; 21 | import org.mybatis.generator.api.dom.xml.XmlElement; 22 | 23 | import java.util.List; 24 | 25 | /** 26 | * --------------------------------------------------------------------------- 27 | * 28 | * --------------------------------------------------------------------------- 29 | * @author: hewei 30 | * @time:2018/4/28 17:50 31 | * --------------------------------------------------------------------------- 32 | */ 33 | public interface IIncrementsPluginHook { 34 | /** 35 | * 生成增量操作节点 36 | * @param introspectedColumn 37 | * @param prefix 38 | * @param hasComma 39 | * @return 40 | */ 41 | List incrementSetElementGenerated(IntrospectedColumn introspectedColumn, String prefix, boolean hasComma); 42 | 43 | /** 44 | * 生成增量操作节点(SelectiveEnhancedPlugin) 45 | * @param columns 46 | * @return 47 | */ 48 | List incrementSetsWithSelectiveEnhancedPluginElementGenerated(List columns); 49 | 50 | /** 51 | * 是否支持increment 52 | * @param column 53 | * @return 54 | */ 55 | boolean supportIncrement(IntrospectedColumn column); 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/com/itfsw/mybatis/generator/plugins/utils/hook/ILombokPluginHook.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.itfsw.mybatis.generator.plugins.utils.hook; 18 | 19 | import org.mybatis.generator.api.IntrospectedTable; 20 | import org.mybatis.generator.api.dom.java.TopLevelClass; 21 | 22 | /** 23 | * --------------------------------------------------------------------------- 24 | * 25 | * --------------------------------------------------------------------------- 26 | * @author: hewei 27 | * @time:2018/10/31 17:27 28 | * --------------------------------------------------------------------------- 29 | */ 30 | public interface ILombokPluginHook { 31 | /** 32 | * Model builder class 生成 33 | * @param topLevelClass 34 | * @param introspectedTable 35 | * @return 36 | */ 37 | boolean modelBaseRecordBuilderClassGenerated(TopLevelClass topLevelClass, IntrospectedTable introspectedTable); 38 | 39 | /** 40 | * Model builder class 生成 41 | * @param topLevelClass 42 | * @param introspectedTable 43 | * @return 44 | */ 45 | boolean modelPrimaryKeyBuilderClassGenerated(TopLevelClass topLevelClass, IntrospectedTable introspectedTable); 46 | 47 | /** 48 | * Model builder class 生成 49 | * @param topLevelClass 50 | * @param introspectedTable 51 | * @return 52 | */ 53 | boolean modelRecordWithBLOBsBuilderClassGenerated(TopLevelClass topLevelClass, IntrospectedTable introspectedTable); 54 | } 55 | -------------------------------------------------------------------------------- /src/test/resources/scripts/ExampleEnhancedPlugin/init.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat MySQL Data Transfer 3 | 4 | Source Server : localhost 5 | Source Server Version : 50617 6 | Source Host : localhost:3306 7 | Source Database : mybatis-generator-plugin 8 | 9 | Target Server Type : MYSQL 10 | Target Server Version : 50617 11 | File Encoding : 65001 12 | 13 | Date: 2017-06-26 17:30:13 14 | */ 15 | 16 | SET FOREIGN_KEY_CHECKS=0; 17 | 18 | -- ---------------------------- 19 | -- Table structure for tb 20 | -- ---------------------------- 21 | DROP TABLE IF EXISTS `tb`; 22 | CREATE TABLE `tb` ( 23 | `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '注释1', 24 | `field1` varchar(255) DEFAULT NULL COMMENT '注释2', 25 | `field2` bigint(20) NOT NULL COMMENT '注释3', 26 | PRIMARY KEY (`id`) 27 | ); 28 | 29 | -- ---------------------------- 30 | -- Records of tb 31 | -- ---------------------------- 32 | INSERT INTO `tb` VALUES ('1', 'f1', '1'); 33 | INSERT INTO `tb` VALUES ('2', 'f2', '1'); 34 | INSERT INTO `tb` VALUES ('3', 'f3', '1'); 35 | INSERT INTO `tb` VALUES ('4', 'f4', '1'); 36 | INSERT INTO `tb` VALUES ('5', 'f5', '1'); 37 | INSERT INTO `tb` VALUES ('6', 'f6', '100'); 38 | INSERT INTO `tb` VALUES ('7', 'f7', '100'); 39 | INSERT INTO `tb` VALUES ('8', 'f8', '100'); 40 | INSERT INTO `tb` VALUES ('9', 'f9', '100'); 41 | INSERT INTO `tb` VALUES ('10', 'f10', '100'); 42 | 43 | -- ---------------------------- 44 | -- Table structure for tb_all 45 | -- ---------------------------- 46 | DROP TABLE IF EXISTS `tb_all`; 47 | CREATE TABLE `tb_all` ( 48 | `key1` bigint(20) NOT NULL COMMENT '注释1', 49 | `key2` varchar(20) NOT NULL COMMENT '注释2', 50 | `field1` varchar(255) DEFAULT NULL COMMENT '注释3', 51 | `field2` bigint(20) NOT NULL COMMENT '注释4', 52 | `field3` longtext COMMENT '注释5', 53 | PRIMARY KEY (`key1`, `key2`) 54 | ); 55 | 56 | -- ---------------------------- 57 | -- Records of tb_all 58 | -- ---------------------------- 59 | INSERT INTO `tb_all` VALUES ('1', 'key1', 'f1', '1', 'b1'); 60 | INSERT INTO `tb_all` VALUES ('2', 'key2', 'f2', '1', 'b2'); 61 | INSERT INTO `tb_all` VALUES ('3', 'key3', 'f3', '1', 'b3'); -------------------------------------------------------------------------------- /src/main/java/com/itfsw/mybatis/generator/plugins/utils/hook/IOptimisticLockerPluginHook.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.itfsw.mybatis.generator.plugins.utils.hook; 18 | 19 | import org.mybatis.generator.api.IntrospectedColumn; 20 | import org.mybatis.generator.api.IntrospectedTable; 21 | import org.mybatis.generator.api.dom.java.Interface; 22 | import org.mybatis.generator.api.dom.java.Method; 23 | import org.mybatis.generator.api.dom.xml.XmlElement; 24 | 25 | import java.util.List; 26 | 27 | /** 28 | * --------------------------------------------------------------------------- 29 | * 30 | * --------------------------------------------------------------------------- 31 | * @author: hewei 32 | * @time:2018/5/4 18:08 33 | * --------------------------------------------------------------------------- 34 | */ 35 | public interface IOptimisticLockerPluginHook { 36 | // ========================================= method 生成 ============================================ 37 | 38 | boolean clientUpdateWithVersionByExampleSelectiveMethodGenerated(Method method, Interface interfaze, IntrospectedTable introspectedTable); 39 | 40 | boolean clientUpdateWithVersionByPrimaryKeySelectiveMethodGenerated(Method method, Interface interfaze, IntrospectedTable introspectedTable); 41 | 42 | // ========================================= sqlMap 生成 ============================================ 43 | 44 | boolean generateSetsSelectiveElement(List columns, IntrospectedColumn versionColumn, XmlElement setsElement); 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/itfsw/mybatis/generator/plugins/utils/hook/IIncrementPluginHook.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.itfsw.mybatis.generator.plugins.utils.hook; 18 | 19 | import org.mybatis.generator.api.IntrospectedColumn; 20 | import org.mybatis.generator.api.dom.xml.XmlElement; 21 | 22 | import java.util.List; 23 | 24 | /** 25 | * --------------------------------------------------------------------------- 26 | * 27 | * --------------------------------------------------------------------------- 28 | * @author: hewei 29 | * @time:2018/4/28 17:50 30 | * --------------------------------------------------------------------------- 31 | */ 32 | public interface IIncrementPluginHook { 33 | /** 34 | * 生成增量操作节点 35 | * @param introspectedColumn 36 | * @param prefix 37 | * @param hasComma 38 | * @return 39 | */ 40 | XmlElement generateIncrementSet(IntrospectedColumn introspectedColumn, String prefix, boolean hasComma); 41 | 42 | /** 43 | * 生成增量操作节点 44 | * @param introspectedColumn 45 | * @param prefix 46 | * @return 47 | */ 48 | XmlElement generateIncrementSetSelective(IntrospectedColumn introspectedColumn, String prefix); 49 | 50 | /** 51 | * 生成增量操作节点(SelectiveEnhancedPlugin) 52 | * @param columns 53 | * @return 54 | */ 55 | List generateIncrementSetForSelectiveEnhancedPlugin(List columns); 56 | 57 | /** 58 | * 是否支持increment 59 | * @param column 60 | * @return 61 | */ 62 | boolean supportIncrement(IntrospectedColumn column); 63 | } 64 | -------------------------------------------------------------------------------- /src/test/java/com/itfsw/mybatis/generator/plugins/DBHelperTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.itfsw.mybatis.generator.plugins; 18 | 19 | import com.itfsw.mybatis.generator.plugins.tools.DBHelper; 20 | import org.junit.Assert; 21 | import org.junit.Test; 22 | 23 | import java.io.IOException; 24 | import java.sql.*; 25 | 26 | /** 27 | * --------------------------------------------------------------------------- 28 | * 29 | * --------------------------------------------------------------------------- 30 | * @author: hewei 31 | * @time:2017/6/26 17:19 32 | * --------------------------------------------------------------------------- 33 | */ 34 | public class DBHelperTest { 35 | /** 36 | * 测试 getSqlSession 37 | * 38 | * @throws IOException 39 | * @throws SQLException 40 | */ 41 | @Test 42 | public void testGetSqlSession() throws Exception { 43 | DBHelper.createDB("scripts/test_init.sql"); 44 | 45 | String driver = DBHelper.properties.getProperty("driver"); 46 | String url = DBHelper.properties.getProperty("url"); 47 | String username = DBHelper.properties.getProperty("username"); 48 | String password = DBHelper.properties.getProperty("password"); 49 | // 获取connection 50 | Class.forName(driver); 51 | Connection connection = DriverManager.getConnection(url, username, password); 52 | 53 | // 执行查询 54 | ResultSet resultSet = DBHelper.execute(connection, "SELECT COUNT(*) as total FROM tb"); 55 | 56 | resultSet.first(); 57 | Assert.assertEquals(resultSet.getInt("total"), 4); 58 | 59 | connection.close(); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/test/resources/scripts/LombokPlugin/mybatis-generator-data.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 33 | 34 | 35 | 36 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /src/test/resources/scripts/MapperAnnotationPlugin/mybatis-generator.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 33 | 34 | 35 | 36 | 40 | 41 | 42 | 43 |
44 | 45 | -------------------------------------------------------------------------------- /src/test/resources/scripts/ModelCloneablePlugin/mybatis-generator.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 33 | 34 | 35 | 36 | 40 | 41 | 42 | 43 |
44 | 45 | -------------------------------------------------------------------------------- /src/main/java/com/itfsw/mybatis/generator/plugins/utils/hook/IModelBuilderPluginHook.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.itfsw.mybatis.generator.plugins.utils.hook; 18 | 19 | import org.mybatis.generator.api.IntrospectedColumn; 20 | import org.mybatis.generator.api.IntrospectedTable; 21 | import org.mybatis.generator.api.dom.java.InnerClass; 22 | import org.mybatis.generator.api.dom.java.Method; 23 | import org.mybatis.generator.api.dom.java.TopLevelClass; 24 | 25 | import java.util.List; 26 | 27 | /** 28 | * --------------------------------------------------------------------------- 29 | * 30 | * --------------------------------------------------------------------------- 31 | * @author: hewei 32 | * @time:2018/4/28 17:29 33 | * --------------------------------------------------------------------------- 34 | */ 35 | public interface IModelBuilderPluginHook { 36 | /** 37 | * Model builder class 生成 38 | * @param topLevelClass 39 | * @param builderClass 40 | * @param columns 41 | * @param introspectedTable 42 | * @return 43 | */ 44 | boolean modelBuilderClassGenerated(TopLevelClass topLevelClass, InnerClass builderClass, List columns, IntrospectedTable introspectedTable); 45 | 46 | /** 47 | * Model builder set 方法生成 48 | * @param method 49 | * @param topLevelClass 50 | * @param builderClass 51 | * @param introspectedColumn 52 | * @param introspectedTable 53 | * @return 54 | */ 55 | boolean modelBuilderSetterMethodGenerated(Method method, TopLevelClass topLevelClass, InnerClass builderClass, IntrospectedColumn introspectedColumn, IntrospectedTable introspectedTable); 56 | } 57 | -------------------------------------------------------------------------------- /src/test/resources/scripts/EnumTypeStatusPlugin/init.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat MySQL Data Transfer 3 | 4 | Source Server : localhost 5 | Source Server Version : 50617 6 | Source Host : localhost:3306 7 | Source Database : mybatis-generator-plugin 8 | 9 | Target Server Type : MYSQL 10 | Target Server Version : 50617 11 | File Encoding : 65001 12 | 13 | Date: 2017-06-26 17:30:13 14 | */ 15 | 16 | SET FOREIGN_KEY_CHECKS=0; 17 | 18 | -- ---------------------------- 19 | -- Table structure for tb 20 | -- ---------------------------- 21 | DROP TABLE IF EXISTS `tb`; 22 | CREATE TABLE `tb` ( 23 | `field1` varchar(255) DEFAULT NULL COMMENT '注释2', 24 | `field2` smallint(3) COMMENT '注释[success(0):禁用, fail_type(1):启用]', 25 | `field3` smallint(3) COMMENT '注释[success(0):禁用, fail_type(1):启用]', 26 | `field3_str` varchar(255) COMMENT '注释111[success(成都):禁用, type(成都11):启用]', 27 | `status` smallint(3) COMMENT '注释[success(0):禁用, fail(1):启用]', 28 | `type` bigint(20) COMMENT '注释 [ success ( 0 ) : 禁用 , fail_type ( 1 ) : 启用 ] 阿斯顿覅就就', 29 | `break_line` bigint(20) COMMENT '换行的注释 30 | [ 31 | success ( 0 ) : 禁用 , 32 | fail_type ( 1 ) : 启用 33 | ] 34 | 发士大夫撒旦法' 35 | ); 36 | 37 | -- ---------------------------- 38 | -- Records of tb 39 | -- ---------------------------- 40 | 41 | -- ---------------------------- 42 | -- Table structure for tb_unsupport_type 43 | -- ---------------------------- 44 | DROP TABLE IF EXISTS `tb_unsupport_type`; 45 | CREATE TABLE `tb_unsupport_type` ( 46 | `field1` varchar(255) DEFAULT NULL COMMENT '注释2', 47 | `field2` blob COMMENT '注释[success(0):禁用, fail_type(1):启用]发士大夫大事发生的' 48 | ); 49 | 50 | -- ---------------------------- 51 | -- Records of tb_unsupport_type 52 | -- ---------------------------- 53 | 54 | -- ---------------------------- 55 | -- Table structure for tb_wrong_comment 56 | -- ---------------------------- 57 | DROP TABLE IF EXISTS `tb_wrong_comment`; 58 | CREATE TABLE `tb_wrong_comment` ( 59 | `field1` varchar(255) DEFAULT NULL COMMENT '注释2', 60 | `field2` smallint(3) COMMENT '注释success(0):禁用, fail_type(1):启用]发士大夫大事发生的' 61 | ); 62 | 63 | -- ---------------------------- 64 | -- Records of tb_wrong_comment 65 | -- ---------------------------- -------------------------------------------------------------------------------- /src/test/resources/scripts/LombokPlugin/mybatis-generator-with-only-keys.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 35 | 36 | 37 | 38 | 42 | 43 | 44 | 45 |
46 | 47 | -------------------------------------------------------------------------------- /src/test/resources/scripts/LombokPlugin/mybatis-generator-accessors.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 35 | 36 | 37 | 38 | 42 | 43 | 44 | 45 |
46 | 47 | -------------------------------------------------------------------------------- /src/test/resources/scripts/UpsertPlugin/mybatis-generator-with-error-driver.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 33 | 34 | 35 | 36 | 40 | 41 | 42 | 43 |
44 | 45 |
46 |
47 |
-------------------------------------------------------------------------------- /src/test/resources/scripts/MapperAnnotationPlugin/mybatis-generator-with-old-repository.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 35 | 36 | 37 | 38 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /src/test/resources/scripts/LombokPlugin/mybatis-generator-builder.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 35 | 36 | 37 | 38 | 42 | 43 | 44 | 45 |
46 |
47 | 48 | -------------------------------------------------------------------------------- /src/test/resources/scripts/ModelColumnPlugin/init.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat MySQL Data Transfer 3 | 4 | Source Server : localhost 5 | Source Server Version : 50617 6 | Source Host : localhost:3306 7 | Source Database : mybatis-generator-plugin 8 | 9 | Target Server Type : MYSQL 10 | Target Server Version : 50617 11 | File Encoding : 65001 12 | 13 | Date: 2017-07-05 17:21:41 14 | */ 15 | 16 | SET FOREIGN_KEY_CHECKS=0; 17 | 18 | -- ---------------------------- 19 | -- Table structure for tb 20 | -- ---------------------------- 21 | DROP TABLE IF EXISTS `tb`; 22 | CREATE TABLE `tb` ( 23 | `id` bigint(20) AUTO_INCREMENT COMMENT '注释1', 24 | `field_1` varchar(255) COMMENT '注释2', 25 | `inc_f1` bigint(20) DEFAULT '0', 26 | `inc_f2` bigint(20) DEFAULT '0', 27 | `inc_f3` bigint(20) DEFAULT '0', 28 | PRIMARY KEY (`id`) 29 | ) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; 30 | 31 | -- ---------------------------- 32 | -- Records of tb 33 | -- ---------------------------- 34 | 35 | -- ---------------------------- 36 | -- Table structure for tb_blobs 37 | -- ---------------------------- 38 | DROP TABLE IF EXISTS `tb_blobs`; 39 | CREATE TABLE `tb_blobs` ( 40 | `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '注释1', 41 | `field_1` varchar(255) DEFAULT NULL, 42 | `field_2` longtext COMMENT '注释2', 43 | `field_3` longtext, 44 | `inc_f1` bigint(20) NOT NULL DEFAULT '0', 45 | `inc_f2` bigint(20) NOT NULL DEFAULT '0', 46 | `inc_f3` bigint(20) NOT NULL DEFAULT '0', 47 | PRIMARY KEY (`id`) 48 | ) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; 49 | 50 | -- ---------------------------- 51 | -- Records of tb_blobs 52 | -- ---------------------------- 53 | 54 | -- ---------------------------- 55 | -- Table structure for tb_keys 56 | -- ---------------------------- 57 | DROP TABLE IF EXISTS `tb_keys`; 58 | CREATE TABLE `tb_keys` ( 59 | `key_1` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '注释1', 60 | `key_2` varchar(255) NOT NULL, 61 | `field_1` varchar(255) DEFAULT NULL COMMENT '注释2', 62 | `field_2` int(11) DEFAULT NULL, 63 | `inc_f1` bigint(20) NOT NULL DEFAULT '0', 64 | `inc_f2` bigint(20) NOT NULL DEFAULT '0', 65 | `inc_f3` bigint(20) NOT NULL DEFAULT '0', 66 | PRIMARY KEY (`key_1`,`key_2`) 67 | ) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; 68 | 69 | -- ---------------------------- 70 | -- Records of tb_keys 71 | -- ---------------------------- 72 | 73 | -------------------------------------------------------------------------------- /src/test/resources/scripts/SelectOneByExamplePlugin/init.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat MySQL Data Transfer 3 | 4 | Source Server : localhost 5 | Source Server Version : 50617 6 | Source Host : localhost:3306 7 | Source Database : mybatis-generator-plugin 8 | 9 | Target Server Type : MYSQL 10 | Target Server Version : 50617 11 | File Encoding : 65001 12 | 13 | Date: 2017-07-03 17:34:11 14 | */ 15 | 16 | SET FOREIGN_KEY_CHECKS=0; 17 | 18 | -- ---------------------------- 19 | -- Table structure for tb 20 | -- ---------------------------- 21 | DROP TABLE IF EXISTS `tb`; 22 | CREATE TABLE `tb` ( 23 | `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '注释1', 24 | `field1` varchar(255) DEFAULT NULL COMMENT '注释2', 25 | `field2` int(11) DEFAULT NULL, 26 | PRIMARY KEY (`id`) 27 | ) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; 28 | 29 | -- ---------------------------- 30 | -- Records of tb 31 | -- ---------------------------- 32 | INSERT INTO `tb` VALUES ('1', 'fd1', null); 33 | INSERT INTO `tb` VALUES ('2', null, '2'); 34 | INSERT INTO `tb` VALUES ('3', 'fd3', '3'); 35 | 36 | -- ---------------------------- 37 | -- Table structure for tb_blobs 38 | -- ---------------------------- 39 | DROP TABLE IF EXISTS `tb_blobs`; 40 | CREATE TABLE `tb_blobs` ( 41 | `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '注释1', 42 | `field1` varchar(255) DEFAULT NULL, 43 | `field2` longtext COMMENT '注释2', 44 | `field3` longtext, 45 | PRIMARY KEY (`id`) 46 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; 47 | 48 | -- ---------------------------- 49 | -- Records of tb_blobs 50 | -- ---------------------------- 51 | INSERT INTO `tb_blobs` VALUES ('1', 'fd1', 'fd2', null); 52 | 53 | -- ---------------------------- 54 | -- Table structure for tb_keys 55 | -- ---------------------------- 56 | DROP TABLE IF EXISTS `tb_keys`; 57 | CREATE TABLE `tb_keys` ( 58 | `key1` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '注释1', 59 | `key2` varchar(255) NOT NULL, 60 | `field1` varchar(255) DEFAULT NULL COMMENT '注释2', 61 | `field2` int(11) DEFAULT NULL, 62 | PRIMARY KEY (`key1`,`key2`) 63 | ) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; 64 | 65 | -- ---------------------------- 66 | -- Records of tb_keys 67 | -- ---------------------------- 68 | INSERT INTO `tb_keys` VALUES ('1', '2', 'fd1', null); 69 | INSERT INTO `tb_keys` VALUES ('2', '3', null, '2'); 70 | INSERT INTO `tb_keys` VALUES ('3', '4', 'fd2', '3'); 71 | -------------------------------------------------------------------------------- /src/test/resources/scripts/LombokPlugin/mybatis-generator-default.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 33 | 34 | 35 | 36 | 37 | 38 | 42 | 43 | 44 | 45 |
46 |
47 | 48 | -------------------------------------------------------------------------------- /src/test/resources/scripts/LombokPlugin/mybatis-generator-constructor.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 36 | 37 | 38 | 39 | 43 | 44 | 45 | 46 |
47 | 48 | -------------------------------------------------------------------------------- /src/test/resources/scripts/BatchInsertPlugin/init.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat MySQL Data Transfer 3 | 4 | Source Server : localhost 5 | Source Server Version : 50617 6 | Source Host : localhost:3306 7 | Source Database : mybatis-generator-plugin 8 | 9 | Target Server Type : MYSQL 10 | Target Server Version : 50617 11 | File Encoding : 65001 12 | 13 | Date: 2017-06-27 11:17:08 14 | */ 15 | 16 | SET FOREIGN_KEY_CHECKS=0; 17 | 18 | -- ---------------------------- 19 | -- Table structure for tb 20 | -- ---------------------------- 21 | DROP TABLE IF EXISTS `tb`; 22 | CREATE TABLE `tb` ( 23 | `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '注释1', 24 | `field1` varchar(255) DEFAULT NULL COMMENT '注释2', 25 | `field2` int DEFAULT NULL, 26 | PRIMARY KEY (`id`) 27 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; 28 | 29 | -- ---------------------------- 30 | -- Records of tb 31 | -- ---------------------------- 32 | 33 | -- ---------------------------- 34 | -- Table structure for tb_blobs 35 | -- ---------------------------- 36 | DROP TABLE IF EXISTS `tb_blobs`; 37 | CREATE TABLE `tb_blobs` ( 38 | `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '注释1', 39 | `field1` varchar(255) DEFAULT NULL, 40 | `field2` longtext COMMENT '注释2', 41 | `field3` longtext, 42 | PRIMARY KEY (`id`) 43 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; 44 | 45 | -- ---------------------------- 46 | -- Records of tb_blobs 47 | -- ---------------------------- 48 | 49 | -- ---------------------------- 50 | -- Table structure for tb_keys 51 | -- ---------------------------- 52 | DROP TABLE IF EXISTS `tb_keys`; 53 | CREATE TABLE `tb_keys` ( 54 | `key1` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '注释1', 55 | `key2` varchar(255) NOT NULL, 56 | `field1` varchar(255) DEFAULT NULL COMMENT '注释2', 57 | `field2` int DEFAULT NULL, 58 | PRIMARY KEY (`key1`,`key2`) 59 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; 60 | 61 | -- ---------------------------- 62 | -- Records of tb_keys 63 | -- ---------------------------- 64 | 65 | -- ---------------------------- 66 | -- Table structure for tb_single_blob 67 | -- ---------------------------- 68 | DROP TABLE IF EXISTS `tb_single_blob`; 69 | CREATE TABLE `tb_single_blob` ( 70 | `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '注释1', 71 | `field1` longtext COMMENT '注释2', 72 | `field2` int DEFAULT NULL, 73 | PRIMARY KEY (`id`) 74 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; 75 | 76 | -- ---------------------------- 77 | -- Records of tb_single_blob 78 | -- ---------------------------- 79 | -------------------------------------------------------------------------------- /src/test/resources/scripts/SelectiveEnhancedPlugin/mybatis-generator-without-ModelColumnPlugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 34 | 35 | 36 | 37 | 41 | 42 | 43 | 44 |
45 | 46 | 47 | 48 |
49 |
50 |
-------------------------------------------------------------------------------- /src/test/resources/scripts/LombokPlugin/mybatis-generator-with-supportSuperBuilderForIdea.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 36 | 37 | 38 | 39 | 43 | 44 | 45 | 46 | 47 |
48 |
49 | 50 | -------------------------------------------------------------------------------- /src/test/resources/scripts/ExampleTargetPlugin/mybatis-generator-without-plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 44 | 45 | 46 | 47 |
48 | 49 |
50 |
51 |
-------------------------------------------------------------------------------- /src/test/resources/scripts/LombokPlugin/mybatis-generator.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 37 | 38 | 39 | 40 | 44 | 45 | 46 | 47 | 48 |
49 |
50 | 51 | -------------------------------------------------------------------------------- /src/test/resources/scripts/MapperAnnotationPlugin/mybatis-generator-with-mapper-false.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 37 | 38 | 39 | 40 | 44 | 45 | 46 | 47 |
48 | 49 | -------------------------------------------------------------------------------- /src/test/resources/scripts/BugFixedTest/issues-77.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 37 | 38 | 39 | 40 | 44 | 45 | 46 | 47 |
48 | 49 |
50 |
51 |
-------------------------------------------------------------------------------- /src/test/resources/scripts/LogicalDeletePlugin/mybatis-generator.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 37 | 38 | 39 | 40 | 44 | 45 | 46 | 47 | 48 | 49 |
50 |
51 |
-------------------------------------------------------------------------------- /src/test/resources/scripts/BugFixedTest/pull-72.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 45 | 46 | 47 | 48 | 49 | 50 |
51 |
52 |
-------------------------------------------------------------------------------- /src/test/resources/scripts/LimitPlugin/mybatis-generator.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 45 | 46 | 47 | 48 | 49 | 50 |
51 |
52 |
-------------------------------------------------------------------------------- /src/test/resources/scripts/LimitPlugin/mybatis-generator-with-error-driver.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 45 | 46 | 47 | 48 | 49 | 50 |
51 |
52 |
-------------------------------------------------------------------------------- /src/test/resources/scripts/LogicalDeletePlugin/mybatis-generator-with-keywords.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 37 | 38 | 39 | 40 | 44 | 45 | 46 | 47 | 48 | 49 |
50 |
51 |
-------------------------------------------------------------------------------- /src/test/resources/scripts/LogicalDeletePlugin/mybatis-generator-with-remarks-enum.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 37 | 38 | 39 | 40 | 44 | 45 | 46 | 47 | 48 | 49 |
50 |
51 |
-------------------------------------------------------------------------------- /src/test/resources/scripts/ExampleEnhancedPlugin/mybatis-generator.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 45 | 46 | 47 | 48 | 49 | 50 |
51 |
52 |
-------------------------------------------------------------------------------- /src/test/resources/scripts/IncrementPlugin/init-lombok.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat MySQL Data Transfer 3 | 4 | Source Server : localhost 5 | Source Server Version : 50617 6 | Source Host : localhost:3306 7 | Source Database : mybatis-generator-plugin 8 | 9 | Target Server Type : MYSQL 10 | Target Server Version : 50617 11 | File Encoding : 65001 12 | 13 | Date: 2017-07-03 17:34:11 14 | */ 15 | 16 | SET FOREIGN_KEY_CHECKS=0; 17 | 18 | -- ---------------------------- 19 | -- Table structure for tb 20 | -- ---------------------------- 21 | DROP TABLE IF EXISTS `tb`; 22 | CREATE TABLE `tb` ( 23 | `id` bigint(20) NOT NULL COMMENT '注释1', 24 | `field1` varchar(255) DEFAULT NULL COMMENT '注释2', 25 | `field2` int(11) DEFAULT NULL, 26 | PRIMARY KEY (`id`) 27 | ) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; 28 | 29 | -- ---------------------------- 30 | -- Records of tb 31 | -- ---------------------------- 32 | INSERT INTO `tb` VALUES ('1', 'fd1', '0'); 33 | INSERT INTO `tb` VALUES ('2', 'fd2', '1'); 34 | INSERT INTO `tb` VALUES ('3', null, '3'); 35 | 36 | -- ---------------------------- 37 | -- Table structure for tb_keys 38 | -- ---------------------------- 39 | DROP TABLE IF EXISTS `tb_keys`; 40 | CREATE TABLE `tb_keys` ( 41 | `key1` bigint(20) NOT NULL COMMENT '注释1', 42 | `key2` varchar(255) NOT NULL, 43 | `field1` varchar(255) DEFAULT NULL COMMENT '注释2', 44 | `field2` int(11) DEFAULT NULL, 45 | `inc_f1` bigint(20) NOT NULL DEFAULT '0', 46 | PRIMARY KEY (`key1`,`key2`) 47 | ) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; 48 | 49 | -- ---------------------------- 50 | -- Records of tb_keys 51 | -- ---------------------------- 52 | INSERT INTO `tb_keys` VALUES ('1', 'key1', 'fd1', '0', '1'); 53 | INSERT INTO `tb_keys` VALUES ('2', 'key2', 'fd2', '1', '2'); 54 | INSERT INTO `tb_keys` VALUES ('3', 'key3', null, '3', '3'); 55 | 56 | -- ---------------------------- 57 | -- Table structure for tb_lombok 58 | -- ---------------------------- 59 | DROP TABLE IF EXISTS `tb_lombok`; 60 | CREATE TABLE `tb_lombok` ( 61 | `id` bigint(20) NOT NULL COMMENT '注释1', 62 | `key1` varchar(20) NOT NULL, 63 | `field1` varchar(10) COMMENT '注释2', 64 | `inc_f1` smallint(3), 65 | `field3` longtext, 66 | `field4` longtext, 67 | PRIMARY KEY (`id`,`key1`) 68 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; 69 | 70 | -- ---------------------------- 71 | -- Records of tb_lombok 72 | -- ---------------------------- 73 | INSERT INTO `tb_lombok` VALUES ('1', 'key1', 'fd1', '0', 'xx1', null); 74 | INSERT INTO `tb_lombok` VALUES ('2', 'key2', 'fd2', '1', 'xx2', 'ss2'); 75 | INSERT INTO `tb_lombok` VALUES ('3', 'key3', null, '3', 'xx3', null); -------------------------------------------------------------------------------- /src/test/resources/scripts/IncrementsPlugin/init-lombok.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat MySQL Data Transfer 3 | 4 | Source Server : localhost 5 | Source Server Version : 50617 6 | Source Host : localhost:3306 7 | Source Database : mybatis-generator-plugin 8 | 9 | Target Server Type : MYSQL 10 | Target Server Version : 50617 11 | File Encoding : 65001 12 | 13 | Date: 2017-07-03 17:34:11 14 | */ 15 | 16 | SET FOREIGN_KEY_CHECKS=0; 17 | 18 | -- ---------------------------- 19 | -- Table structure for tb 20 | -- ---------------------------- 21 | DROP TABLE IF EXISTS `tb`; 22 | CREATE TABLE `tb` ( 23 | `id` bigint(20) NOT NULL COMMENT '注释1', 24 | `field1` varchar(255) DEFAULT NULL COMMENT '注释2', 25 | `field2` int(11) DEFAULT NULL, 26 | PRIMARY KEY (`id`) 27 | ) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; 28 | 29 | -- ---------------------------- 30 | -- Records of tb 31 | -- ---------------------------- 32 | INSERT INTO `tb` VALUES ('1', 'fd1', '0'); 33 | INSERT INTO `tb` VALUES ('2', 'fd2', '1'); 34 | INSERT INTO `tb` VALUES ('3', null, '3'); 35 | 36 | -- ---------------------------- 37 | -- Table structure for tb_keys 38 | -- ---------------------------- 39 | DROP TABLE IF EXISTS `tb_keys`; 40 | CREATE TABLE `tb_keys` ( 41 | `key1` bigint(20) NOT NULL COMMENT '注释1', 42 | `key2` varchar(255) NOT NULL, 43 | `field1` varchar(255) DEFAULT NULL COMMENT '注释2', 44 | `field2` int(11) DEFAULT NULL, 45 | `inc_f1` bigint(20) NOT NULL DEFAULT '0', 46 | PRIMARY KEY (`key1`,`key2`) 47 | ) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; 48 | 49 | -- ---------------------------- 50 | -- Records of tb_keys 51 | -- ---------------------------- 52 | INSERT INTO `tb_keys` VALUES ('1', 'key1', 'fd1', '0', '1'); 53 | INSERT INTO `tb_keys` VALUES ('2', 'key2', 'fd2', '1', '2'); 54 | INSERT INTO `tb_keys` VALUES ('3', 'key3', null, '3', '3'); 55 | 56 | -- ---------------------------- 57 | -- Table structure for tb_lombok 58 | -- ---------------------------- 59 | DROP TABLE IF EXISTS `tb_lombok`; 60 | CREATE TABLE `tb_lombok` ( 61 | `id` bigint(20) NOT NULL COMMENT '注释1', 62 | `key1` varchar(20) NOT NULL, 63 | `field1` varchar(10) COMMENT '注释2', 64 | `inc_f1` smallint(3), 65 | `field3` longtext, 66 | `field4` longtext, 67 | PRIMARY KEY (`id`,`key1`) 68 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; 69 | 70 | -- ---------------------------- 71 | -- Records of tb_lombok 72 | -- ---------------------------- 73 | INSERT INTO `tb_lombok` VALUES ('1', 'key1', 'fd1', '0', 'xx1', null); 74 | INSERT INTO `tb_lombok` VALUES ('2', 'key2', 'fd2', '1', 'xx2', 'ss2'); 75 | INSERT INTO `tb_lombok` VALUES ('3', 'key3', null, '3', 'xx3', null); -------------------------------------------------------------------------------- /src/test/resources/scripts/ModelBuilderPlugin/mybatis-generator.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 34 | 35 | 36 | 37 | 41 | 42 | 43 | 44 | 45 | 46 |
47 | 48 |
49 | 50 | 51 |
52 | 53 | 54 | -------------------------------------------------------------------------------- /src/test/resources/scripts/IncrementPlugin/mybatis-generator-without-model-column-plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 46 | 47 | 48 | 49 |
50 | 51 |
52 |
53 |
-------------------------------------------------------------------------------- /src/test/resources/scripts/IncrementsPlugin/mybatis-generator-without-model-builder-plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 46 | 47 | 48 | 49 | 50 | 51 |
52 |
53 |
-------------------------------------------------------------------------------- /src/test/resources/scripts/ModelColumnPlugin/mybatis-generator.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 34 | 35 | 36 | 37 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 |
49 | 50 |
51 | 52 | 53 |
54 |
55 |
-------------------------------------------------------------------------------- /src/test/resources/scripts/EnumTypeStatusPlugin/mybatis-generator.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /src/test/resources/scripts/BugFixedTest/issues-76.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 47 | 48 | 49 | 50 |
51 | 52 |
53 |
54 |
-------------------------------------------------------------------------------- /src/test/resources/scripts/TablePrefixPlugin/mybatis-generator-with-domainObject.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 46 | 47 | 48 | 49 | 50 | 51 |
52 |
53 |
-------------------------------------------------------------------------------- /src/test/resources/scripts/TableRenamePlugin/mybatis-generator-with-domainObject.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 46 | 47 | 48 | 49 | 50 | 51 |
52 |
53 |
-------------------------------------------------------------------------------- /src/test/resources/scripts/BatchInsertPlugin/mybatis-generator-without-model-column-plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 46 | 47 | 48 | 49 | 50 | 51 |
52 |
53 |
-------------------------------------------------------------------------------- /src/test/resources/scripts/ExampleTargetPlugin/mybatis-generator-without-target.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 47 | 48 | 49 | 50 | 51 | 52 |
53 |
54 |
-------------------------------------------------------------------------------- /src/test/resources/scripts/LimitPlugin/mybatis-generator-with-startPage.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 47 | 48 | 49 | 50 | 51 | 52 |
53 |
54 |
-------------------------------------------------------------------------------- /src/test/resources/scripts/SelectiveEnhancedPlugin/mybatis-generator.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 38 | 39 | 40 | 41 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 |
53 |
54 |
-------------------------------------------------------------------------------- /src/main/java/com/itfsw/mybatis/generator/plugins/utils/BeanUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.itfsw.mybatis.generator.plugins.utils; 18 | 19 | import java.lang.reflect.Field; 20 | import java.lang.reflect.InvocationTargetException; 21 | import java.lang.reflect.Method; 22 | 23 | /** 24 | * --------------------------------------------------------------------------- 25 | * 26 | * --------------------------------------------------------------------------- 27 | * @author: hewei 28 | * @time:2018/5/3 18:39 29 | * --------------------------------------------------------------------------- 30 | */ 31 | public class BeanUtils { 32 | /** 33 | * 设置属性 34 | * @param bean 35 | * @param name 36 | * @param value 37 | * @throws NoSuchFieldException 38 | * @throws IllegalAccessException 39 | */ 40 | public static void setProperty(final Object bean, final String name, final Object value) throws NoSuchFieldException, IllegalAccessException { 41 | Field field = bean.getClass().getDeclaredField(name); 42 | field.setAccessible(true); 43 | field.set(bean, value); 44 | } 45 | 46 | /** 47 | * 获取属性 48 | * @param bean 49 | * @param name 50 | * @return 51 | */ 52 | public static Object getProperty(final Object bean, final String name) throws NoSuchFieldException, IllegalAccessException { 53 | Field field = bean.getClass().getDeclaredField(name); 54 | field.setAccessible(true); 55 | return field.get(bean); 56 | } 57 | 58 | /** 59 | * 执行无参方法 60 | * @param bean 61 | * @param clazz 62 | * @param name 63 | * @return 64 | * @throws NoSuchMethodException 65 | * @throws InvocationTargetException 66 | * @throws IllegalAccessException 67 | */ 68 | public static Object invoke(final Object bean, Class clazz, final String name) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { 69 | Method method = clazz.getDeclaredMethod(name); 70 | method.setAccessible(true); 71 | return method.invoke(bean); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/test/resources/scripts/SelectOneByExamplePlugin/mybatis-generator.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 33 | 34 | 35 | 36 | 40 | 41 | 42 | 43 | 44 | 45 |
46 | 47 |
48 | 49 |
50 | 51 | 52 |
53 |
54 |
-------------------------------------------------------------------------------- /src/test/resources/scripts/BugFixedTest/issues-63.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 48 | 49 | 50 | 51 | 52 | 53 |
54 |
55 |
-------------------------------------------------------------------------------- /src/test/resources/scripts/ModelColumnPlugin/mybatis-generator-with-SeleciveEnhancedPlugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 38 | 39 | 40 | 41 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 |
53 |
54 |
-------------------------------------------------------------------------------- /src/test/resources/scripts/TableRenamePlugin/mybatis-generator-with-wrong-properties.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 48 | 49 | 50 | 51 | 52 | 53 |
54 |
55 |
-------------------------------------------------------------------------------- /src/main/java/com/itfsw/mybatis/generator/plugins/utils/hook/ISelectOneByExamplePluginHook.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.itfsw.mybatis.generator.plugins.utils.hook; 18 | 19 | import org.mybatis.generator.api.IntrospectedTable; 20 | import org.mybatis.generator.api.dom.java.Interface; 21 | import org.mybatis.generator.api.dom.java.Method; 22 | import org.mybatis.generator.api.dom.xml.Document; 23 | import org.mybatis.generator.api.dom.xml.XmlElement; 24 | 25 | /** 26 | * --------------------------------------------------------------------------- 27 | * 28 | * --------------------------------------------------------------------------- 29 | * @author: hewei 30 | * @time:2018/5/7 18:51 31 | * --------------------------------------------------------------------------- 32 | */ 33 | public interface ISelectOneByExamplePluginHook { 34 | 35 | /** 36 | * selectOneByExampleWithBLOBs 接口方法生成 37 | * @param method 38 | * @param interfaze 39 | * @param introspectedTable 40 | * @return 41 | */ 42 | boolean clientSelectOneByExampleWithBLOBsMethodGenerated(Method method, Interface interfaze, IntrospectedTable introspectedTable); 43 | 44 | /** 45 | * selectOneByExample 接口方法生成 46 | * @param method 47 | * @param interfaze 48 | * @param introspectedTable 49 | * @return 50 | */ 51 | boolean clientSelectOneByExampleWithoutBLOBsMethodGenerated(Method method, Interface interfaze, IntrospectedTable introspectedTable); 52 | 53 | /** 54 | * selectOneByExample 方法sqlMap实现 55 | * @param document 56 | * @param element 57 | * @param introspectedTable 58 | * @return 59 | */ 60 | boolean sqlMapSelectOneByExampleWithoutBLOBsElementGenerated(Document document, XmlElement element, IntrospectedTable introspectedTable); 61 | 62 | /** 63 | * selectOneByExampleWithBLOBs 方法sqlMap实现 64 | * @param document 65 | * @param element 66 | * @param introspectedTable 67 | * @return 68 | */ 69 | boolean sqlMapSelectOneByExampleWithBLOBsElementGenerated(Document document, XmlElement element, IntrospectedTable introspectedTable); 70 | } 71 | -------------------------------------------------------------------------------- /src/test/resources/scripts/LogicalDeletePlugin/mybatis-generator-with-customConstName.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 39 | 40 | 41 | 42 | 46 | 47 | 48 | 49 | 50 | 51 |
52 |
53 |
-------------------------------------------------------------------------------- /src/test/resources/scripts/BugFixedTest/issues-70-mybatis-3-5-0.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 48 | 49 | 50 | 51 | 52 | 53 |
54 |
55 |
-------------------------------------------------------------------------------- /src/test/resources/scripts/ExampleEnhancedPlugin/mybatis-generator-with-ModelColumnPlugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 46 | 47 | 48 | 49 | 50 | 51 |
52 | 53 | 54 | -------------------------------------------------------------------------------- /src/test/resources/scripts/BugFixedTest/pull-103.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 47 | 48 | 49 | 50 |
51 | 52 |
53 |
54 |
-------------------------------------------------------------------------------- /src/test/resources/scripts/BatchInsertPlugin/mybatis-generator-with-error-driver.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 48 | 49 | 50 | 51 | 52 | 53 |
54 |
55 |
-------------------------------------------------------------------------------- /src/test/resources/scripts/ExampleTargetPlugin/mybatis-generator.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 49 | 50 | 51 | 52 | 53 | 54 |
55 |
56 |
-------------------------------------------------------------------------------- /src/test/resources/scripts/TableRenameConfigurationPlugin/mybatis-generator-with-clientSuffix.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 48 | 49 | 50 | 51 | 52 | 53 |
54 | 55 | 56 | -------------------------------------------------------------------------------- /src/test/resources/scripts/TableRenameConfigurationPlugin/mybatis-generator-with-modelSuffix.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 48 | 49 | 50 | 51 |
52 | 53 |
54 | 55 | 56 | -------------------------------------------------------------------------------- /src/test/resources/scripts/TableRenameConfigurationPlugin/mybatis-generator-with-exampleSuffix.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 48 | 49 | 50 | 51 |
52 | 53 |
54 | 55 | 56 | -------------------------------------------------------------------------------- /src/test/java/com/itfsw/mybatis/generator/plugins/ModelCloneablePluginTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.itfsw.mybatis.generator.plugins; 18 | 19 | import com.itfsw.mybatis.generator.plugins.tools.AbstractShellCallback; 20 | import com.itfsw.mybatis.generator.plugins.tools.DBHelper; 21 | import com.itfsw.mybatis.generator.plugins.tools.MyBatisGeneratorTool; 22 | import com.itfsw.mybatis.generator.plugins.tools.ObjectUtil; 23 | import org.apache.ibatis.session.SqlSession; 24 | import org.junit.Assert; 25 | import org.junit.BeforeClass; 26 | import org.junit.Test; 27 | 28 | /** 29 | * --------------------------------------------------------------------------- 30 | * 31 | * --------------------------------------------------------------------------- 32 | * @author: hewei 33 | * @time:2018/11/7 15:43 34 | * --------------------------------------------------------------------------- 35 | */ 36 | public class ModelCloneablePluginTest { 37 | /** 38 | * 初始化 39 | */ 40 | @BeforeClass 41 | public static void init() throws Exception { 42 | DBHelper.createDB("scripts/ModelCloneablePlugin/init.sql"); 43 | } 44 | 45 | /** 46 | * 测试生成的model 47 | */ 48 | @Test 49 | public void testModel() throws Exception { 50 | MyBatisGeneratorTool tool = MyBatisGeneratorTool.create("scripts/ModelCloneablePlugin/mybatis-generator.xml"); 51 | tool.generate(new AbstractShellCallback() { 52 | @Override 53 | public void reloadProject(SqlSession sqlSession, ClassLoader loader, String packagz) throws Exception { 54 | ObjectUtil tb = new ObjectUtil(loader, packagz + ".Tb"); 55 | tb.set("id", 100L); 56 | tb.set("field1", "ts1"); 57 | 58 | ObjectUtil tbClone = new ObjectUtil(tb.invoke("clone")); 59 | Assert.assertEquals(tbClone.get("id"), 100L); 60 | Assert.assertEquals(tbClone.get("field1"), "ts1"); 61 | 62 | tbClone.set("field1", "ts2"); 63 | Assert.assertEquals(tb.get("field1"), "ts1"); 64 | Assert.assertEquals(tbClone.get("field1"), "ts2"); 65 | } 66 | }); 67 | } 68 | 69 | } -------------------------------------------------------------------------------- /src/test/resources/scripts/LimitPlugin/mybatis-generator-with-SelectSelectivePlugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 47 | 48 | 49 | 50 |
51 | 52 |
53 |
54 |
-------------------------------------------------------------------------------- /src/test/resources/scripts/BugFixedTest/issues-81.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /src/test/resources/scripts/LogicalDeletePlugin/mybatis-generator-with-unconfig-logicalDeleteValue.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 47 | 48 | 49 | 50 |
51 | 52 | 53 |
54 |
55 |
-------------------------------------------------------------------------------- /src/test/resources/scripts/BugFixedTest/issues-70-mybatis-3-4-0.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 50 | 51 | 52 | 53 | 54 | 55 |
56 |
57 |
-------------------------------------------------------------------------------- /src/test/resources/scripts/BugFixedTest/issues-39.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 49 | 50 | 51 | 52 | 53 | 54 |
55 | 56 |
57 |
58 |
-------------------------------------------------------------------------------- /src/test/resources/scripts/EnumTypeStatusPlugin/mybatis-generator-with-unsupport-type.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 51 | 52 | 53 | 54 | 55 | 56 |
57 |
58 |
-------------------------------------------------------------------------------- /src/test/resources/scripts/EnumTypeStatusPlugin/mybatis-generator-with-wrong-comment.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 51 | 52 | 53 | 54 | 55 | 56 |
57 |
58 |
--------------------------------------------------------------------------------