您的位置:首页技术文章
文章详情页

Java实战之实现一个好用的MybatisPlus代码生成器

【字号: 日期:2022-08-13 14:49:53浏览:3作者:猪猪
一、先看下项目结构

CodeGenerator:生成器主类

resources下的mapper.java.vm:一个模板类,用以在生成dao层时按模板来生成代码

Java实战之实现一个好用的MybatisPlus代码生成器

比如我们想把代码按如下目录来生成:

代码层 代码生成位置 Controller层 com.yinchd.web.controller Service层 com.yinchd.web.service Service实现类 com.yinchd.web.service implMapper层 com.yinchd.web.mapper xml文件 com.yinchd.web.mapper.xml Model层 com.yinchd.web.model 二、先引入MybatisPlus及Generator相关的依赖

项目是SpringBoot项目,我略去了其它依赖,只保留了MybatisPlus及Generator相关的依赖

<properties><mybatis-plus.version>3.4.2</mybatis-plus.version><mybatis-plus-generator.version>3.4.1</mybatis-plus-generator.version><velocity-engine-core.version>2.0</velocity-engine-core.version></properties>

<!-- Mybatis-Plus--><dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-boot-starter</artifactId> <version>${mybatis-plus.version}</version></dependency><dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-extension</artifactId> <version>${mybatis-plus.version}</version></dependency><!-- Mybatis-Plus-Generator --><dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-generator</artifactId> <version>${mybatis-plus-generator.version}</version></dependency><!-- 模板引擎(Mybatis-Plus-Generator会用到) --><dependency> <groupId>org.apache.velocity</groupId> <artifactId>velocity-engine-core</artifactId> <version>${velocity-engine-core.version}</version></dependency>三、具体代码3.1 mapper.java.vm

这里主要就是解决dao层生成时没有加@Mapper注解的这个问题

所以这个文件里,我主要加了一个@Mapper注解,加了import org.apache.ibatis.annotations.Mapper;这一行,其它代码都是vm文件原始的内容

package ${package.Mapper};import ${package.Entity}.${entity};import ${superMapperClassPackage};import org.apache.ibatis.annotations.Mapper;/** * <p> * $!{table.comment} Mapper 接口 * </p> * * @author ${author} * @since ${date} */#if(${kotlin})interface ${table.mapperName} : ${superMapperClass}<${entity}>#else@Mapperpublic interface ${table.mapperName} extends ${superMapperClass}<${entity}> {}#end3.2 CodeGenerator

package com.yinchd.web;import com.baomidou.mybatisplus.annotation.DbType;import com.baomidou.mybatisplus.generator.AutoGenerator;import com.baomidou.mybatisplus.generator.config.*;import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;/** * Mybatis生成器 * * @author yinchd * @date 2019 /3/26 */public class CodeGenerator { /** * 当前项目的路径 */ static final String PROJECT_PATH = System.getProperty('user.dir'); /** * java文件路径 */ static final String CODE_HOME = '/src/main/java'; /** * 代码生成器入口. */ public static void main(String[] args) {// 待生成的表名String tableName = 'sys_role';// 生成的时候要去掉的表前缀,如果不需要去除什么前缀,则这里为空就行String trimTablePrefix = 'sys_';// 生成文件的父包路径String codeGeneratePath = 'com.yinchd.web';System.out.println('开始生成如下表:' + tableName + ' 到 ' + codeGeneratePath + ' 目录中...');// 后面三个boolean值分别代表是否生成Controller、Service、Dao和实体,有时我们改了表结构,这里可以方便控制生成哪些,不生成哪些generate(tableName, trimTablePrefix, codeGeneratePath, true, true, true);System.out.println('生成成功...'); } /** * 代码生成入口 * @param tableName 表名 * @param trimTablePrefix 要去除的表前缀 eg:表名:t_user, 如果不去除`t_`前缀的话,则生成的类名为TUser,如果去掉,则生成的类名为User * @param basePkg 生成文件的父包路径 * @param controller 是否生成controller * @param service 是否生成service * @param mapper 是否生成mapper */ private static void generate(String tableName, String trimTablePrefix, String basePkg, boolean controller, boolean service, boolean mapper) {AutoGenerator generator = new AutoGenerator();// 全局配置generator.setGlobalConfig(getGlobalConfig());// 数据源generator.setDataSource(getDataSourceConfig());// 生成策略generator.setStrategy(getStrategyConfig(tableName, trimTablePrefix));// 生成模板generator.setTemplate(getTemplateConfig(controller, service, mapper));// 生成目标信息generator.setPackageInfo(getPackageConfig(basePkg));// 执行生成generator.execute(); } private static PackageConfig getPackageConfig(String basePkg) {// 包配置PackageConfig packageConfig = new PackageConfig();// 父包路径packageConfig.setParent(basePkg);packageConfig.setController('controller');packageConfig.setService('service');packageConfig.setServiceImpl('service.impl');packageConfig.setMapper('mapper');packageConfig.setEntity('model');packageConfig.setXml('mapper.xml');return packageConfig; } private static GlobalConfig getGlobalConfig() {// 全局配置GlobalConfig globalConfig = new GlobalConfig();// 生成文件输出根目录globalConfig.setOutputDir(PROJECT_PATH + CODE_HOME);// 生成完成后不弹出文件框globalConfig.setOpen(false);// 文件覆盖globalConfig.setFileOverride(true);// 不需要ActiveRecord特性的请改为falseglobalConfig.setActiveRecord(false);// XML 二级缓存globalConfig.setEnableCache(false);// XML ResultMapglobalConfig.setBaseResultMap(true);// XML columListglobalConfig.setBaseColumnList(false);// 作者globalConfig.setAuthor('yinchd');globalConfig.setSwagger2(true);// 自定义文件命名,注意 %s 会自动填充表实体属性!globalConfig.setControllerName('%sController');globalConfig.setServiceName('%sService');globalConfig.setServiceImplName('%sServiceImpl');globalConfig.setMapperName('%sMapper');globalConfig.setXmlName('%sMapper');globalConfig.setEntityName('%sModel');return globalConfig; } private static TemplateConfig getTemplateConfig(boolean controller, boolean service, boolean mapper) {// 解决Mapper.java上没有@Mapper注解的问题TemplateConfig templateConfig = new TemplateConfig();if (!controller) { templateConfig.setController('');}if (!service) { templateConfig.setService('').setServiceImpl('');}templateConfig.setMapper('/generator/mapper.java.vm');if (!mapper) { templateConfig.setMapper('').setXml('');}return templateConfig; } private static StrategyConfig getStrategyConfig(String tableName, String trimTablePrefix) {// 策略配置StrategyConfig strategy = new StrategyConfig();// 表名生成策略strategy.setNaming(NamingStrategy.underline_to_camel);strategy.setColumnNaming(NamingStrategy.underline_to_camel);// 需要生成的表strategy.setInclude(tableName);strategy.setSuperServiceClass('com.baomidou.mybatisplus.extension.service.IService');strategy.setSuperServiceImplClass('com.baomidou.mybatisplus.extension.service.impl.ServiceImpl');strategy.setSuperMapperClass('com.baomidou.mybatisplus.core.mapper.BaseMapper');strategy.setEntityLombokModel(true);strategy.setRestControllerStyle(true);strategy.setControllerMappingHyphenStyle(true);strategy.setEntityColumnConstant(true);strategy.setEntityBuilderModel(true);strategy.setEntityTableFieldAnnotationEnable(true);// 去除表前缀if (trimTablePrefix != null && !''.equals(trimTablePrefix)) { strategy.setTablePrefix(trimTablePrefix);}// 去除字段前缀// strategy.setFieldPrefix('');return strategy; } private static DataSourceConfig getDataSourceConfig() {DataSourceConfig dataSourceConfig = new DataSourceConfig();// 设置数据库类型dataSourceConfig.setDbType(DbType.MYSQL);dataSourceConfig.setDriverName('com.mysql.cj.jdbc.Driver');// 指定数据库 master库dataSourceConfig.setUrl('jdbc:mysql://ip:3306/db?useUnicode=true&zeroDateTimeBehavior=convertToNull&autoReconnect=true&characterEncoding=utf-8&useSSL=false');// 用户名dataSourceConfig.setUsername('root');// 密码dataSourceConfig.setPassword('password');return dataSourceConfig; }}3.3 生成测试

建一张t_test表来测试,表结构如下

CREATE TABLE `t_test` ( `id` INT (10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT ’id主键’, `name` VARCHAR (20) NOT NULL COMMENT ’名称’, `sex` CHAR (1) NOT NULL COMMENT ’性别’, `hobby` VARCHAR (100) COMMENT ’爱好’, `mobile` VARCHAR (11) COMMENT ’手机号’, `create_time` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT ’创建时间’, PRIMARY KEY (`id`)) COMMENT = ’测试表’;

初始化两条数据

INSERT INTO `t_test` (`name`, `sex`, `hobby`, `mobile`) VALUES (’jack’, ’男’, ’女’, ’15888888888’); INSERT INTO `t_test` (`name`, `sex`, `hobby`, `mobile`) VALUES (’rose’, ’女’, ’jack’, ’18888888888’);

执行CodeGenerator的main方法,来生成对应的代码

public static void main(String[] args) { // 待生成的表名 String tableName = 't_test'; // 生成的时候要去掉的表前缀,如果不需要去除什么前缀,则这里为空就行 String trimTablePrefix = 't_'; // 生成文件的父包路径 String codeGeneratePath = 'com.yinchd.web'; System.out.println('开始生成如下表:' + tableName + ' 到 ' + codeGeneratePath + ' 目录中...'); generate(tableName, trimTablePrefix, codeGeneratePath, true, true, true); System.out.println('生成成功...');}

正确执行如下

'C:Program FilesJavajdk1.8.0_231binjava.exe' -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:59499,suspend=y,server=n -javaagent:C:UsersAdministratorAppDataLocalJetBrainsIntelliJIdea2020.3captureAgentdebugger-agent.jar -Dfile.encoding=UTF-8 -classpath 'C:Program FilesJavajdk1.8.0_231jrelibcharsets.jar;C:Program FilesJavajdk1.8.0_231jrelibdeploy.jar;C:Program FilesJavajdk1.8.0_231jrelibextaccess-bridge-64.jar;C:Program FilesJavajdk1.8.0_231jrelibextcldrdata.jar;C:Program FilesJavajdk1.8.0_231jrelibextdnsns.jar;C:Program FilesJavajdk1.8.0_231jrelibextjaccess.jar;C:Program FilesJavajdk1.8.0_231jrelibextjfxrt.jar;C:Program FilesJavajdk1.8.0_231jrelibextlocaledata.jar;C:Program FilesJavajdk1.8.0_231jrelibextnashorn.jar;C:Program FilesJavajdk1.8.0_231jrelibextsunec.jar;C:Program FilesJavajdk1.8.0_231jrelibextsunjce_provider.jar;C:Program FilesJavajdk1.8.0_231jrelibextsunmscapi.jar;C:Program FilesJavajdk1.8.0_231jrelibextsunpkcs11.jar;C:Program FilesJavajdk1.8.0_231jrelibextzipfs.jar;C:Program FilesJavajdk1.8.0_231jrelibjavaws.jar;C:Program FilesJavajdk1.8.0_231jrelibjce.jar;C:Program FilesJavajdk1.8.0_231jrelibjfr.jar;C:Program FilesJavajdk1.8.0_231jrelibjfxswt.jar;C:Program FilesJavajdk1.8.0_231jrelibjsse.jar;C:Program FilesJavajdk1.8.0_231jrelibmanagement-agent.jar;C:Program FilesJavajdk1.8.0_231jrelibplugin.jar;C:Program FilesJavajdk1.8.0_231jrelibresources.jar;C:Program FilesJavajdk1.8.0_231jrelibrt.jar;D:WorkSpacemyweb-boottargetclasses;D:Repositoryorgspringframeworkbootspring-boot-starter2.4.3spring-boot-starter-2.4.3.jar;D:Repositoryorgspringframeworkbootspring-boot2.4.3spring-boot-2.4.3.jar;D:Repositoryorgspringframeworkbootspring-boot-autoconfigure2.4.3spring-boot-autoconfigure-2.4.3.jar;D:Repositoryorgspringframeworkbootspring-boot-starter-logging2.4.3spring-boot-starter-logging-2.4.3.jar;D:Repositoryorgapachelogginglog4jlog4j-to-slf4j2.13.3log4j-to-slf4j-2.13.3.jar;D:Repositoryorgslf4jjul-to-slf4j1.7.30jul-to-slf4j-1.7.30.jar;D:Repositoryjakartaannotationjakarta.annotation-api1.3.5jakarta.annotation-api-1.3.5.jar;D:Repositoryorgspringframeworkspring-core5.3.4spring-core-5.3.4.jar;D:Repositoryorgspringframeworkspring-jcl5.3.4spring-jcl-5.3.4.jar;D:Repositoryorgyamlsnakeyaml1.27snakeyaml-1.27.jar;D:Repositoryorgspringframeworkbootspring-boot-starter-web2.4.3spring-boot-starter-web-2.4.3.jar;D:Repositoryorgspringframeworkbootspring-boot-starter-json2.4.3spring-boot-starter-json-2.4.3.jar;D:Repositorycomfasterxmljacksondatatypejackson-datatype-jdk82.11.4jackson-datatype-jdk8-2.11.4.jar;D:Repositorycomfasterxmljacksondatatypejackson-datatype-jsr3102.11.4jackson-datatype-jsr310-2.11.4.jar;D:Repositorycomfasterxmljacksonmodulejackson-module-parameter-names2.11.4jackson-module-parameter-names-2.11.4.jar;D:Repositoryorgspringframeworkspring-web5.3.4spring-web-5.3.4.jar;D:Repositoryorgspringframeworkspring-beans5.3.4spring-beans-5.3.4.jar;D:Repositoryorgspringframeworkspring-webmvc5.3.4spring-webmvc-5.3.4.jar;D:Repositoryorgspringframeworkspring-aop5.3.4spring-aop-5.3.4.jar;D:Repositoryorgspringframeworkspring-expression5.3.4spring-expression-5.3.4.jar;D:Repositoryorgspringframeworkbootspring-boot-starter-undertow2.4.3spring-boot-starter-undertow-2.4.3.jar;D:Repositoryioundertowundertow-core2.2.4.Finalundertow-core-2.2.4.Final.jar;D:Repositoryorgjbossloggingjboss-logging3.4.1.Finaljboss-logging-3.4.1.Final.jar;D:Repositoryorgjbossxnioxnio-api3.8.0.Finalxnio-api-3.8.0.Final.jar;D:Repositoryorgwildflycommonwildfly-common1.5.2.Finalwildfly-common-1.5.2.Final.jar;D:Repositoryorgwildflyclientwildfly-client-config1.0.1.Finalwildfly-client-config-1.0.1.Final.jar;D:Repositoryorgjbossxnioxnio-nio3.8.0.Finalxnio-nio-3.8.0.Final.jar;D:Repositoryorgjbossthreadsjboss-threads3.1.0.Finaljboss-threads-3.1.0.Final.jar;D:Repositoryioundertowundertow-servlet2.2.4.Finalundertow-servlet-2.2.4.Final.jar;D:Repositoryorgjbossspecjavaxannotationjboss-annotations-api_1.3_spec2.0.1.Finaljboss-annotations-api_1.3_spec-2.0.1.Final.jar;D:Repositoryioundertowundertow-websockets-jsr2.2.4.Finalundertow-websockets-jsr-2.2.4.Final.jar;D:Repositoryorgjbossspecjavaxwebsocketjboss-websocket-api_1.1_spec2.0.0.Finaljboss-websocket-api_1.1_spec-2.0.0.Final.jar;D:Repositoryjakartaservletjakarta.servlet-api4.0.4jakarta.servlet-api-4.0.4.jar;D:Repositoryorgglassfishjakarta.el3.0.3jakarta.el-3.0.3.jar;D:Repositorynetbytebuddybyte-buddy1.10.20byte-buddy-1.10.20.jar;D:Repositoryorgspringframeworkbootspring-boot-configuration-processor2.4.3spring-boot-configuration-processor-2.4.3.jar;D:Repositorycomalibabadruid-spring-boot-starter1.2.5druid-spring-boot-starter-1.2.5.jar;D:Repositorycomalibabadruid1.2.5druid-1.2.5.jar;D:Repositoryjavaxannotationjavax.annotation-api1.3.2javax.annotation-api-1.3.2.jar;D:Repositoryorgslf4jslf4j-api1.7.30slf4j-api-1.7.30.jar;D:Repositorymysqlmysql-connector-java8.0.23mysql-connector-java-8.0.23.jar;D:Repositoryiospringfoxspringfox-boot-starter3.0.0springfox-boot-starter-3.0.0.jar;D:Repositoryiospringfoxspringfox-oas3.0.0springfox-oas-3.0.0.jar;D:Repositoryioswaggercorev3swagger-annotations2.1.2swagger-annotations-2.1.2.jar;D:Repositoryioswaggercorev3swagger-models2.1.2swagger-models-2.1.2.jar;D:Repositoryiospringfoxspringfox-spi3.0.0springfox-spi-3.0.0.jar;D:Repositoryiospringfoxspringfox-schema3.0.0springfox-schema-3.0.0.jar;D:Repositoryiospringfoxspringfox-core3.0.0springfox-core-3.0.0.jar;D:Repositoryiospringfoxspringfox-spring-web3.0.0springfox-spring-web-3.0.0.jar;D:Repositoryiogithubclassgraphclassgraph4.8.83classgraph-4.8.83.jar;D:Repositoryiospringfoxspringfox-spring-webmvc3.0.0springfox-spring-webmvc-3.0.0.jar;D:Repositoryiospringfoxspringfox-spring-webflux3.0.0springfox-spring-webflux-3.0.0.jar;D:Repositoryiospringfoxspringfox-swagger-common3.0.0springfox-swagger-common-3.0.0.jar;D:Repositoryorgmapstructmapstruct1.3.1.Finalmapstruct-1.3.1.Final.jar;D:Repositoryiospringfoxspringfox-data-rest3.0.0springfox-data-rest-3.0.0.jar;D:Repositoryiospringfoxspringfox-bean-validators3.0.0springfox-bean-validators-3.0.0.jar;D:Repositoryiospringfoxspringfox-swagger23.0.0springfox-swagger2-3.0.0.jar;D:Repositoryioswaggerswagger-annotations1.5.20swagger-annotations-1.5.20.jar;D:Repositoryioswaggerswagger-models1.5.20swagger-models-1.5.20.jar;D:Repositoryiospringfoxspringfox-swagger-ui3.0.0springfox-swagger-ui-3.0.0.jar;D:Repositorycomfasterxmlclassmate1.5.1classmate-1.5.1.jar;D:Repositoryorgspringframeworkpluginspring-plugin-core2.0.0.RELEASEspring-plugin-core-2.0.0.RELEASE.jar;D:Repositoryorgspringframeworkpluginspring-plugin-metadata2.0.0.RELEASEspring-plugin-metadata-2.0.0.RELEASE.jar;D:Repositorycombaomidoumybatis-plus-boot-starter3.4.2mybatis-plus-boot-starter-3.4.2.jar;D:Repositorycombaomidoumybatis-plus3.4.2mybatis-plus-3.4.2.jar;D:Repositoryorgspringframeworkbootspring-boot-starter-jdbc2.4.3spring-boot-starter-jdbc-2.4.3.jar;D:RepositorycomzaxxerHikariCP3.4.5HikariCP-3.4.5.jar;D:Repositoryorgspringframeworkspring-jdbc5.3.4spring-jdbc-5.3.4.jar;D:Repositorycombaomidoumybatis-plus-extension3.4.2mybatis-plus-extension-3.4.2.jar;D:Repositorycombaomidoumybatis-plus-core3.4.2mybatis-plus-core-3.4.2.jar;D:Repositorycombaomidoumybatis-plus-annotation3.4.2mybatis-plus-annotation-3.4.2.jar;D:Repositorycomgithubjsqlparserjsqlparser4.0jsqlparser-4.0.jar;D:Repositoryorgmybatismybatis3.5.6mybatis-3.5.6.jar;D:Repositoryorgmybatismybatis-spring2.0.5mybatis-spring-2.0.5.jar;D:Repositorycombaomidoumybatis-plus-generator3.4.1mybatis-plus-generator-3.4.1.jar;D:Repositoryorgapachevelocityvelocity-engine-core2.0velocity-engine-core-2.0.jar;D:Repositoryorgapachecommonscommons-lang33.11commons-lang3-3.11.jar;D:Repositoryorgspringframeworkbootspring-boot-starter-data-redis2.4.3spring-boot-starter-data-redis-2.4.3.jar;D:Repositoryorgspringframeworkdataspring-data-redis2.4.5spring-data-redis-2.4.5.jar;D:Repositoryorgspringframeworkdataspring-data-keyvalue2.4.5spring-data-keyvalue-2.4.5.jar;D:Repositoryorgspringframeworkspring-tx5.3.4spring-tx-5.3.4.jar;D:Repositoryorgspringframeworkspring-oxm5.3.4spring-oxm-5.3.4.jar;D:Repositoryorgspringframeworkspring-context-support5.3.4spring-context-support-5.3.4.jar;D:Repositoryiolettucelettuce-core6.0.2.RELEASElettuce-core-6.0.2.RELEASE.jar;D:Repositoryionettynetty-common4.1.59.Finalnetty-common-4.1.59.Final.jar;D:Repositoryionettynetty-handler4.1.59.Finalnetty-handler-4.1.59.Final.jar;D:Repositoryionettynetty-resolver4.1.59.Finalnetty-resolver-4.1.59.Final.jar;D:Repositoryionettynetty-buffer4.1.59.Finalnetty-buffer-4.1.59.Final.jar;D:Repositoryionettynetty-codec4.1.59.Finalnetty-codec-4.1.59.Final.jar;D:Repositoryionettynetty-transport4.1.59.Finalnetty-transport-4.1.59.Final.jar;D:Repositoryioprojectreactorreactor-core3.4.3reactor-core-3.4.3.jar;D:Repositoryorgreactivestreamsreactive-streams1.0.3reactive-streams-1.0.3.jar;D:Repositoryorgapachecommonscommons-pool22.9.0commons-pool2-2.9.0.jar;D:Repositorycomgoogleguavaguava30.1-jreguava-30.1-jre.jar;D:Repositorycomgoogleguavafailureaccess1.0.1failureaccess-1.0.1.jar;D:Repositorycomgoogleguavalistenablefuture9999.0-empty-to-avoid-conflict-with-guavalistenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar;D:Repositorycomgooglecodefindbugsjsr3053.0.2jsr305-3.0.2.jar;D:Repositoryorgcheckerframeworkchecker-qual3.5.0checker-qual-3.5.0.jar;D:Repositorycomgoogleerrorproneerror_prone_annotations2.3.4error_prone_annotations-2.3.4.jar;D:Repositorycomgooglej2objcj2objc-annotations1.3j2objc-annotations-1.3.jar;D:Repositorycomgithubaxetkaptcha0.0.9kaptcha-0.0.9.jar;D:Repositorycomjhlabsfilters2.0.235filters-2.0.235.jar;D:Repositorycomalibabafastjson1.2.60fastjson-1.2.60.jar;D:Repositorycommons-beanutilscommons-beanutils1.9.3commons-beanutils-1.9.3.jar;D:Repositorycommons-loggingcommons-logging1.2commons-logging-1.2.jar;D:Repositorycommons-collectionscommons-collections3.2.2commons-collections-3.2.2.jar;D:Repositorycomgithubtobatofastdfs-client1.26.7fastdfs-client-1.26.7.jar;D:Repositoryorgslf4jjcl-over-slf4j1.7.30jcl-over-slf4j-1.7.30.jar;D:Repositorychqoslogbacklogback-classic1.2.3logback-classic-1.2.3.jar;D:Repositorychqoslogbacklogback-core1.2.3logback-core-1.2.3.jar;D:Repositorycommons-iocommons-io2.4commons-io-2.4.jar;D:Repositoryorghibernatevalidatorhibernate-validator6.1.7.Finalhibernate-validator-6.1.7.Final.jar;D:Repositoryjakartavalidationjakarta.validation-api2.0.2jakarta.validation-api-2.0.2.jar;D:Repositoryorgspringframeworkspring-context5.3.4spring-context-5.3.4.jar;D:Repositorynetcoobirdthumbnailator0.4.8thumbnailator-0.4.8.jar;D:Repositoryorgbouncycastlebcprov-jdk15on1.64bcprov-jdk15on-1.64.jar;D:Repositoryiojsonwebtokenjjwt0.9.1jjwt-0.9.1.jar;D:Repositorycomfasterxmljacksoncorejackson-databind2.11.4jackson-databind-2.11.4.jar;D:Repositorycomgithubulisesbocchiojasypt-spring-boot-starter3.0.2jasypt-spring-boot-starter-3.0.2.jar;D:Repositorycomgithubulisesbocchiojasypt-spring-boot3.0.2jasypt-spring-boot-3.0.2.jar;D:Repositoryorgjasyptjasypt1.9.3jasypt-1.9.3.jar;D:Repositoryiominiominio8.1.0minio-8.1.0.jar;D:Repositorycomcarrotsearchthirdpartysimple-xml-safe2.7.1simple-xml-safe-2.7.1.jar;D:Repositorycomsquareupokhttp3okhttp3.14.9okhttp-3.14.9.jar;D:Repositorycomsquareupokiookio1.17.2okio-1.17.2.jar;D:Repositorycomfasterxmljacksoncorejackson-annotations2.11.4jackson-annotations-2.11.4.jar;D:Repositorycomfasterxmljacksoncorejackson-core2.11.4jackson-core-2.11.4.jar;D:Repositoryorgspringframeworkbootspring-boot-starter-data-elasticsearch2.4.3spring-boot-starter-data-elasticsearch-2.4.3.jar;D:Repositoryorgspringframeworkdataspring-data-elasticsearch4.1.5spring-data-elasticsearch-4.1.5.jar;D:Repositoryorgspringframeworkdataspring-data-commons2.4.5spring-data-commons-2.4.5.jar;D:Repositoryorgelasticsearchplugintransport-netty4-client7.9.3transport-netty4-client-7.9.3.jar;D:Repositoryionettynetty-codec-http4.1.59.Finalnetty-codec-http-4.1.59.Final.jar;D:Repositoryorgelasticsearchclientelasticsearch-rest-high-level-client7.6.2elasticsearch-rest-high-level-client-7.6.2.jar;D:Repositoryorgelasticsearchpluginmapper-extras-client7.6.2mapper-extras-client-7.6.2.jar;D:Repositoryorgelasticsearchpluginparent-join-client7.6.2parent-join-client-7.6.2.jar;D:Repositoryorgelasticsearchpluginaggs-matrix-stats-client7.6.2aggs-matrix-stats-client-7.6.2.jar;D:Repositoryorgelasticsearchpluginrank-eval-client7.6.2rank-eval-client-7.6.2.jar;D:Repositoryorgelasticsearchpluginlang-mustache-client7.6.2lang-mustache-client-7.6.2.jar;D:Repositorycomgithubspullaramustachejavacompiler0.9.6compiler-0.9.6.jar;D:Repositoryorgelasticsearchelasticsearch7.6.2elasticsearch-7.6.2.jar;D:Repositoryorgelasticsearchelasticsearch-core7.6.2elasticsearch-core-7.6.2.jar;D:Repositoryorgelasticsearchelasticsearch-secure-sm7.6.2elasticsearch-secure-sm-7.6.2.jar;D:Repositoryorgelasticsearchelasticsearch-x-content7.6.2elasticsearch-x-content-7.6.2.jar;D:Repositorycomfasterxmljacksondataformatjackson-dataformat-smile2.11.4jackson-dataformat-smile-2.11.4.jar;D:Repositorycomfasterxmljacksondataformatjackson-dataformat-yaml2.11.4jackson-dataformat-yaml-2.11.4.jar;D:Repositorycomfasterxmljacksondataformatjackson-dataformat-cbor2.11.4jackson-dataformat-cbor-2.11.4.jar;D:Repositoryorgelasticsearchelasticsearch-geo7.6.2elasticsearch-geo-7.6.2.jar;D:Repositoryorgapachelucenelucene-core8.4.0lucene-core-8.4.0.jar;D:Repositoryorgapachelucenelucene-analyzers-common8.4.0lucene-analyzers-common-8.4.0.jar;D:Repositoryorgapachelucenelucene-backward-codecs8.4.0lucene-backward-codecs-8.4.0.jar;D:Repositoryorgapachelucenelucene-grouping8.4.0lucene-grouping-8.4.0.jar;D:Repositoryorgapachelucenelucene-highlighter8.4.0lucene-highlighter-8.4.0.jar;D:Repositoryorgapachelucenelucene-join8.4.0lucene-join-8.4.0.jar;D:Repositoryorgapachelucenelucene-memory8.4.0lucene-memory-8.4.0.jar;D:Repositoryorgapachelucenelucene-misc8.4.0lucene-misc-8.4.0.jar;D:Repositoryorgapachelucenelucene-queries8.4.0lucene-queries-8.4.0.jar;D:Repositoryorgapachelucenelucene-queryparser8.4.0lucene-queryparser-8.4.0.jar;D:Repositoryorgapachelucenelucene-sandbox8.4.0lucene-sandbox-8.4.0.jar;D:Repositoryorgapachelucenelucene-spatial8.4.0lucene-spatial-8.4.0.jar;D:Repositoryorgapachelucenelucene-spatial-extras8.4.0lucene-spatial-extras-8.4.0.jar;D:Repositoryorgapachelucenelucene-spatial3d8.4.0lucene-spatial3d-8.4.0.jar;D:Repositoryorgapachelucenelucene-suggest8.4.0lucene-suggest-8.4.0.jar;D:Repositoryorgelasticsearchelasticsearch-cli7.6.2elasticsearch-cli-7.6.2.jar;D:Repositorynetsfjopt-simplejopt-simple5.0.2jopt-simple-5.0.2.jar;D:Repositorycomcarrotsearchhppc0.8.1hppc-0.8.1.jar;D:Repositoryjoda-timejoda-time2.10.4joda-time-2.10.4.jar;D:Repositorycomtdunningt-digest3.2t-digest-3.2.jar;D:RepositoryorghdrhistogramHdrHistogram2.1.9HdrHistogram-2.1.9.jar;D:Repositoryorgapachelogginglog4jlog4j-api2.13.3log4j-api-2.13.3.jar;D:Repositoryorgelasticsearchjna4.5.1jna-4.5.1.jar;D:Repositoryorgelasticsearchclientelasticsearch-rest-client7.6.2elasticsearch-rest-client-7.6.2.jar;D:Repositoryorgapachehttpcomponentshttpclient4.5.13httpclient-4.5.13.jar;D:Repositoryorgapachehttpcomponentshttpcore4.4.14httpcore-4.4.14.jar;D:Repositoryorgapachehttpcomponentshttpasyncclient4.1.4httpasyncclient-4.1.4.jar;D:Repositoryorgapachehttpcomponentshttpcore-nio4.4.14httpcore-nio-4.4.14.jar;D:Repositorycommons-codeccommons-codec1.15commons-codec-1.15.jar;C:Program FilesJetBrainsIntelliJ IDEAlibidea_rt.jar' com.yinchd.web.CodeGeneratorConnected to the target VM, address: ’127.0.0.1:59499’, transport: ’socket’开始生成如下表:t_test 到 com.yinchd.web 目录中...16:59:49.843 [main] DEBUG com.baomidou.mybatisplus.generator.AutoGenerator - ==========================准备生成文件...==========================16:59:50.480 [main] DEBUG org.apache.velocity - Initializing Velocity, Calling init()...16:59:50.480 [main] DEBUG org.apache.velocity - Starting Apache Velocity v2.016:59:50.485 [main] DEBUG org.apache.velocity - Default Properties resource: org/apache/velocity/runtime/defaults/velocity.properties16:59:50.507 [main] DEBUG org.apache.velocity - ResourceLoader instantiated: org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader16:59:50.510 [main] DEBUG org.apache.velocity - initialized (class org.apache.velocity.runtime.resource.ResourceCacheImpl) with class java.util.Collections$SynchronizedMap cache map.16:59:50.512 [main] DEBUG org.apache.velocity - Loaded System Directive: org.apache.velocity.runtime.directive.Stop16:59:50.514 [main] DEBUG org.apache.velocity - Loaded System Directive: org.apache.velocity.runtime.directive.Define16:59:50.515 [main] DEBUG org.apache.velocity - Loaded System Directive: org.apache.velocity.runtime.directive.Break16:59:50.515 [main] DEBUG org.apache.velocity - Loaded System Directive: org.apache.velocity.runtime.directive.Evaluate16:59:50.516 [main] DEBUG org.apache.velocity - Loaded System Directive: org.apache.velocity.runtime.directive.Macro16:59:50.518 [main] DEBUG org.apache.velocity - Loaded System Directive: org.apache.velocity.runtime.directive.Parse16:59:50.519 [main] DEBUG org.apache.velocity - Loaded System Directive: org.apache.velocity.runtime.directive.Include16:59:50.520 [main] DEBUG org.apache.velocity - Loaded System Directive: org.apache.velocity.runtime.directive.Foreach16:59:50.542 [main] DEBUG org.apache.velocity.parser - Created ’20’ parsers.16:59:50.577 [main] DEBUG org.apache.velocity.macro - 'velocimacro.library' is not set. Trying default library: VM_global_library.vm16:59:50.578 [main] DEBUG org.apache.velocity.loader.file - Could not load resource ’VM_global_library.vm’ from ResourceLoader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader16:59:50.578 [main] DEBUG org.apache.velocity.macro - Default library not found.16:59:50.578 [main] DEBUG org.apache.velocity.macro - allowInline = true: VMs can be defined inline in templates16:59:50.578 [main] DEBUG org.apache.velocity.macro - allowInlineToOverride = false: VMs defined inline may NOT replace previous VM definitions16:59:50.578 [main] DEBUG org.apache.velocity.macro - allowInlineLocal = false: VMs defined inline will be global in scope if allowed.16:59:50.578 [main] DEBUG org.apache.velocity.macro - autoload off: VM system will not automatically reload global library macros16:59:50.622 [main] DEBUG org.apache.velocity.loader - ResourceManager: found /templates/entity.java.vm with loader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader16:59:50.626 [main] DEBUG org.apache.velocity.rendering - =================================================================16:59:50.626 [main] DEBUG org.apache.velocity.rendering - == Class: class java.util.HashMap16:59:50.628 [main] DEBUG org.apache.velocity.rendering - Reflecting class java.util.HashMap16:59:50.630 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.Object java.util.HashMap.remove(java.lang.Object)16:59:50.630 [main] DEBUG org.apache.velocity.rendering - Adding public boolean java.util.HashMap.remove(java.lang.Object,java.lang.Object)16:59:50.630 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.Object java.util.HashMap.get(java.lang.Object)16:59:50.630 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.Object java.util.HashMap.put(java.lang.Object,java.lang.Object)16:59:50.631 [main] DEBUG org.apache.velocity.rendering - Adding public java.util.Collection java.util.HashMap.values()16:59:50.631 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.Object java.util.HashMap.clone()16:59:50.631 [main] DEBUG org.apache.velocity.rendering - Adding public void java.util.HashMap.clear()16:59:50.631 [main] DEBUG org.apache.velocity.rendering - Adding public boolean java.util.HashMap.isEmpty()16:59:50.631 [main] DEBUG org.apache.velocity.rendering - Adding public boolean java.util.HashMap.replace(java.lang.Object,java.lang.Object,java.lang.Object)16:59:50.631 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.Object java.util.HashMap.replace(java.lang.Object,java.lang.Object)16:59:50.631 [main] DEBUG org.apache.velocity.rendering - Adding public void java.util.HashMap.replaceAll(java.util.function.BiFunction)16:59:50.631 [main] DEBUG org.apache.velocity.rendering - Adding public int java.util.HashMap.size()16:59:50.631 [main] DEBUG org.apache.velocity.rendering - Adding public java.util.Set java.util.HashMap.entrySet()16:59:50.631 [main] DEBUG org.apache.velocity.rendering - Adding public void java.util.HashMap.putAll(java.util.Map)16:59:50.631 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.Object java.util.HashMap.putIfAbsent(java.lang.Object,java.lang.Object)16:59:50.631 [main] DEBUG org.apache.velocity.rendering - Adding public void java.util.HashMap.forEach(java.util.function.BiConsumer)16:59:50.631 [main] DEBUG org.apache.velocity.rendering - Adding public java.util.Set java.util.HashMap.keySet()16:59:50.631 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.Object java.util.HashMap.compute(java.lang.Object,java.util.function.BiFunction)16:59:50.631 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.Object java.util.HashMap.computeIfAbsent(java.lang.Object,java.util.function.Function)16:59:50.631 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.Object java.util.HashMap.computeIfPresent(java.lang.Object,java.util.function.BiFunction)16:59:50.631 [main] DEBUG org.apache.velocity.rendering - Adding public boolean java.util.HashMap.containsKey(java.lang.Object)16:59:50.631 [main] DEBUG org.apache.velocity.rendering - Adding public boolean java.util.HashMap.containsValue(java.lang.Object)16:59:50.631 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.Object java.util.HashMap.getOrDefault(java.lang.Object,java.lang.Object)16:59:50.631 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.Object java.util.HashMap.merge(java.lang.Object,java.lang.Object,java.util.function.BiFunction)16:59:50.631 [main] DEBUG org.apache.velocity.rendering - Reflecting interface java.util.Map16:59:50.631 [main] DEBUG org.apache.velocity.rendering - Adding public abstract boolean java.util.Map.equals(java.lang.Object)16:59:50.631 [main] DEBUG org.apache.velocity.rendering - Adding public abstract int java.util.Map.hashCode()16:59:50.631 [main] DEBUG org.apache.velocity.rendering - Reflecting interface java.lang.Cloneable16:59:50.631 [main] DEBUG org.apache.velocity.rendering - Reflecting interface java.io.Serializable16:59:50.631 [main] DEBUG org.apache.velocity.rendering - Reflecting class java.util.AbstractMap16:59:50.631 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.String java.util.AbstractMap.toString()16:59:50.631 [main] DEBUG org.apache.velocity.rendering - Reflecting interface java.util.Map16:59:50.632 [main] DEBUG org.apache.velocity.rendering - Reflecting class java.lang.Object16:59:50.632 [main] DEBUG org.apache.velocity.rendering - Adding public final void java.lang.Object.wait() throws java.lang.InterruptedException16:59:50.632 [main] DEBUG org.apache.velocity.rendering - Adding public final void java.lang.Object.wait(long,int) throws java.lang.InterruptedException16:59:50.632 [main] DEBUG org.apache.velocity.rendering - Adding public final native void java.lang.Object.wait(long) throws java.lang.InterruptedException16:59:50.632 [main] DEBUG org.apache.velocity.rendering - Adding public final native java.lang.Class java.lang.Object.getClass()16:59:50.632 [main] DEBUG org.apache.velocity.rendering - Adding public final native void java.lang.Object.notify()16:59:50.632 [main] DEBUG org.apache.velocity.rendering - Adding public final native void java.lang.Object.notifyAll()16:59:50.632 [main] DEBUG org.apache.velocity.rendering - =================================================================16:59:50.635 [main] DEBUG org.apache.velocity.rendering - =================================================================16:59:50.635 [main] DEBUG org.apache.velocity.rendering - == Class: class com.baomidou.mybatisplus.generator.config.po.TableInfo16:59:50.635 [main] DEBUG org.apache.velocity.rendering - Reflecting class com.baomidou.mybatisplus.generator.config.po.TableInfo16:59:50.635 [main] DEBUG org.apache.velocity.rendering - Adding public boolean com.baomidou.mybatisplus.generator.config.po.TableInfo.equals(java.lang.Object)16:59:50.635 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.String com.baomidou.mybatisplus.generator.config.po.TableInfo.toString()16:59:50.635 [main] DEBUG org.apache.velocity.rendering - Adding public int com.baomidou.mybatisplus.generator.config.po.TableInfo.hashCode()16:59:50.635 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.String com.baomidou.mybatisplus.generator.config.po.TableInfo.getName()16:59:50.636 [main] DEBUG org.apache.velocity.rendering - Adding public java.util.List com.baomidou.mybatisplus.generator.config.po.TableInfo.getFields()16:59:50.636 [main] DEBUG org.apache.velocity.rendering - Adding public com.baomidou.mybatisplus.generator.config.po.TableInfo com.baomidou.mybatisplus.generator.config.po.TableInfo.setName(java.lang.String)16:59:50.636 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.String com.baomidou.mybatisplus.generator.config.po.TableInfo.getComment()16:59:50.636 [main] DEBUG org.apache.velocity.rendering - Adding public com.baomidou.mybatisplus.generator.config.po.TableInfo com.baomidou.mybatisplus.generator.config.po.TableInfo.setComment(java.lang.String)16:59:50.636 [main] DEBUG org.apache.velocity.rendering - Adding public com.baomidou.mybatisplus.generator.config.po.TableInfo com.baomidou.mybatisplus.generator.config.po.TableInfo.setServiceName(java.lang.String)16:59:50.636 [main] DEBUG org.apache.velocity.rendering - Adding public com.baomidou.mybatisplus.generator.config.po.TableInfo com.baomidou.mybatisplus.generator.config.po.TableInfo.setMapperName(java.lang.String)16:59:50.636 [main] DEBUG org.apache.velocity.rendering - Adding public com.baomidou.mybatisplus.generator.config.po.TableInfo com.baomidou.mybatisplus.generator.config.po.TableInfo.setXmlName(java.lang.String)16:59:50.636 [main] DEBUG org.apache.velocity.rendering - Adding public com.baomidou.mybatisplus.generator.config.po.TableInfo com.baomidou.mybatisplus.generator.config.po.TableInfo.setEntityName(com.baomidou.mybatisplus.generator.config.StrategyConfig,java.lang.String)16:59:50.636 [main] DEBUG org.apache.velocity.rendering - Adding public com.baomidou.mybatisplus.generator.config.po.TableInfo com.baomidou.mybatisplus.generator.config.po.TableInfo.setEntityName(java.lang.String)16:59:50.636 [main] DEBUG org.apache.velocity.rendering - Adding public com.baomidou.mybatisplus.generator.config.po.TableInfo com.baomidou.mybatisplus.generator.config.po.TableInfo.setConvert(boolean)16:59:50.636 [main] DEBUG org.apache.velocity.rendering - Adding public boolean com.baomidou.mybatisplus.generator.config.po.TableInfo.isConvert()16:59:50.636 [main] DEBUG org.apache.velocity.rendering - Adding public boolean com.baomidou.mybatisplus.generator.config.po.TableInfo.isLogicDelete(java.lang.String)16:59:50.636 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.String com.baomidou.mybatisplus.generator.config.po.TableInfo.getServiceName()16:59:50.636 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.String com.baomidou.mybatisplus.generator.config.po.TableInfo.getEntityPath()16:59:50.636 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.String com.baomidou.mybatisplus.generator.config.po.TableInfo.getMapperName()16:59:50.636 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.String com.baomidou.mybatisplus.generator.config.po.TableInfo.getEntityName()16:59:50.636 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.String com.baomidou.mybatisplus.generator.config.po.TableInfo.getXmlName()16:59:50.636 [main] DEBUG org.apache.velocity.rendering - Adding public com.baomidou.mybatisplus.generator.config.po.TableInfo com.baomidou.mybatisplus.generator.config.po.TableInfo.setServiceImplName(java.lang.String)16:59:50.636 [main] DEBUG org.apache.velocity.rendering - Adding public com.baomidou.mybatisplus.generator.config.po.TableInfo com.baomidou.mybatisplus.generator.config.po.TableInfo.setImportPackages(java.lang.String)16:59:50.636 [main] DEBUG org.apache.velocity.rendering - Adding public com.baomidou.mybatisplus.generator.config.po.TableInfo com.baomidou.mybatisplus.generator.config.po.TableInfo.setControllerName(java.lang.String)16:59:50.636 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.String com.baomidou.mybatisplus.generator.config.po.TableInfo.getServiceImplName()16:59:50.636 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.String com.baomidou.mybatisplus.generator.config.po.TableInfo.getControllerName()16:59:50.636 [main] DEBUG org.apache.velocity.rendering - Adding public java.util.Set com.baomidou.mybatisplus.generator.config.po.TableInfo.getImportPackages()16:59:50.636 [main] DEBUG org.apache.velocity.rendering - Adding public com.baomidou.mybatisplus.generator.config.po.TableInfo com.baomidou.mybatisplus.generator.config.po.TableInfo.setHavePrimaryKey(boolean)16:59:50.636 [main] DEBUG org.apache.velocity.rendering - Adding public com.baomidou.mybatisplus.generator.config.po.TableInfo com.baomidou.mybatisplus.generator.config.po.TableInfo.setCommonFields(java.util.List)16:59:50.636 [main] DEBUG org.apache.velocity.rendering - Adding public boolean com.baomidou.mybatisplus.generator.config.po.TableInfo.isHavePrimaryKey()16:59:50.636 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.String com.baomidou.mybatisplus.generator.config.po.TableInfo.getFieldNames()16:59:50.637 [main] DEBUG org.apache.velocity.rendering - Adding public com.baomidou.mybatisplus.generator.config.po.TableInfo com.baomidou.mybatisplus.generator.config.po.TableInfo.setFields(java.util.List)16:59:50.637 [main] DEBUG org.apache.velocity.rendering - Adding public com.baomidou.mybatisplus.generator.config.po.TableInfo com.baomidou.mybatisplus.generator.config.po.TableInfo.setFieldNames(java.lang.String)16:59:50.637 [main] DEBUG org.apache.velocity.rendering - Adding public java.util.List com.baomidou.mybatisplus.generator.config.po.TableInfo.getCommonFields()16:59:50.637 [main] DEBUG org.apache.velocity.rendering - Reflecting class java.lang.Object16:59:50.637 [main] DEBUG org.apache.velocity.rendering - Adding public final void java.lang.Object.wait() throws java.lang.InterruptedException16:59:50.637 [main] DEBUG org.apache.velocity.rendering - Adding public final void java.lang.Object.wait(long,int) throws java.lang.InterruptedException16:59:50.637 [main] DEBUG org.apache.velocity.rendering - Adding public final native void java.lang.Object.wait(long) throws java.lang.InterruptedException16:59:50.637 [main] DEBUG org.apache.velocity.rendering - Adding public final native java.lang.Class java.lang.Object.getClass()16:59:50.637 [main] DEBUG org.apache.velocity.rendering - Adding public final native void java.lang.Object.notify()16:59:50.637 [main] DEBUG org.apache.velocity.rendering - Adding public final native void java.lang.Object.notifyAll()16:59:50.637 [main] DEBUG org.apache.velocity.rendering - =================================================================16:59:50.639 [main] DEBUG org.apache.velocity.rendering - =================================================================16:59:50.639 [main] DEBUG org.apache.velocity.rendering - == Class: class com.baomidou.mybatisplus.generator.config.po.TableField16:59:50.640 [main] DEBUG org.apache.velocity.rendering - Reflecting class com.baomidou.mybatisplus.generator.config.po.TableField16:59:50.640 [main] DEBUG org.apache.velocity.rendering - Adding public boolean com.baomidou.mybatisplus.generator.config.po.TableField.equals(java.lang.Object)16:59:50.640 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.String com.baomidou.mybatisplus.generator.config.po.TableField.toString()16:59:50.640 [main] DEBUG org.apache.velocity.rendering - Adding public int com.baomidou.mybatisplus.generator.config.po.TableField.hashCode()16:59:50.640 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.String com.baomidou.mybatisplus.generator.config.po.TableField.getName()16:59:50.640 [main] DEBUG org.apache.velocity.rendering - Adding public com.baomidou.mybatisplus.generator.config.po.TableField com.baomidou.mybatisplus.generator.config.po.TableField.setName(java.lang.String)16:59:50.640 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.String com.baomidou.mybatisplus.generator.config.po.TableField.getType()16:59:50.640 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.String com.baomidou.mybatisplus.generator.config.po.TableField.getComment()16:59:50.640 [main] DEBUG org.apache.velocity.rendering - Adding public com.baomidou.mybatisplus.generator.config.po.TableField com.baomidou.mybatisplus.generator.config.po.TableField.setComment(java.lang.String)16:59:50.640 [main] DEBUG org.apache.velocity.rendering - Adding public boolean com.baomidou.mybatisplus.generator.config.po.TableField.isKeyFlag()16:59:50.640 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.String com.baomidou.mybatisplus.generator.config.po.TableField.getPropertyType()16:59:50.640 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.String com.baomidou.mybatisplus.generator.config.po.TableField.getPropertyName()16:59:50.640 [main] DEBUG org.apache.velocity.rendering - Adding public com.baomidou.mybatisplus.generator.config.po.TableField com.baomidou.mybatisplus.generator.config.po.TableField.setConvert(boolean)16:59:50.640 [main] DEBUG org.apache.velocity.rendering - Adding public boolean com.baomidou.mybatisplus.generator.config.po.TableField.isConvert()16:59:50.640 [main] DEBUG org.apache.velocity.rendering - Adding public com.baomidou.mybatisplus.generator.config.po.TableField com.baomidou.mybatisplus.generator.config.po.TableField.setPropertyName(com.baomidou.mybatisplus.generator.config.StrategyConfig,java.lang.String)16:59:50.640 [main] DEBUG org.apache.velocity.rendering - Adding public com.baomidou.mybatisplus.generator.config.po.TableField com.baomidou.mybatisplus.generator.config.po.TableField.setPropertyName(java.lang.String)16:59:50.640 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.String com.baomidou.mybatisplus.generator.config.po.TableField.getAnnotationColumnName()16:59:50.640 [main] DEBUG org.apache.velocity.rendering - Adding public boolean com.baomidou.mybatisplus.generator.config.po.TableField.isKeyIdentityFlag()16:59:50.640 [main] DEBUG org.apache.velocity.rendering - Adding public com.baomidou.mybatisplus.generator.config.po.TableField com.baomidou.mybatisplus.generator.config.po.TableField.setKeyIdentityFlag(boolean)16:59:50.641 [main] DEBUG org.apache.velocity.rendering - Adding public com.baomidou.mybatisplus.generator.config.po.TableField com.baomidou.mybatisplus.generator.config.po.TableField.setColumnType(com.baomidou.mybatisplus.generator.config.rules.IColumnType)16:59:50.641 [main] DEBUG org.apache.velocity.rendering - Adding public com.baomidou.mybatisplus.generator.config.po.TableField com.baomidou.mybatisplus.generator.config.po.TableField.setFill(java.lang.String)16:59:50.641 [main] DEBUG org.apache.velocity.rendering - Adding public com.baomidou.mybatisplus.generator.config.po.TableField com.baomidou.mybatisplus.generator.config.po.TableField.setType(java.lang.String)16:59:50.641 [main] DEBUG org.apache.velocity.rendering - Adding public com.baomidou.mybatisplus.generator.config.po.TableField com.baomidou.mybatisplus.generator.config.po.TableField.setKeyFlag(boolean)16:59:50.641 [main] DEBUG org.apache.velocity.rendering - Adding public com.baomidou.mybatisplus.generator.config.po.TableField com.baomidou.mybatisplus.generator.config.po.TableField.setCustomMap(java.util.Map)16:59:50.641 [main] DEBUG org.apache.velocity.rendering - Adding public boolean com.baomidou.mybatisplus.generator.config.po.TableField.isKeyWords()16:59:50.641 [main] DEBUG org.apache.velocity.rendering - Adding public com.baomidou.mybatisplus.generator.config.po.TableField com.baomidou.mybatisplus.generator.config.po.TableField.setKeyWords(boolean)16:59:50.641 [main] DEBUG org.apache.velocity.rendering - Adding public com.baomidou.mybatisplus.generator.config.po.TableField com.baomidou.mybatisplus.generator.config.po.TableField.setColumnName(java.lang.String)16:59:50.641 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.String com.baomidou.mybatisplus.generator.config.po.TableField.getColumnName()16:59:50.641 [main] DEBUG org.apache.velocity.rendering - Adding public com.baomidou.mybatisplus.generator.config.rules.IColumnType com.baomidou.mybatisplus.generator.config.po.TableField.getColumnType()16:59:50.641 [main] DEBUG org.apache.velocity.rendering - Adding public java.util.Map com.baomidou.mybatisplus.generator.config.po.TableField.getCustomMap()16:59:50.641 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.String com.baomidou.mybatisplus.generator.config.po.TableField.getFill()16:59:50.641 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.String com.baomidou.mybatisplus.generator.config.po.TableField.getCapitalName()16:59:50.641 [main] DEBUG org.apache.velocity.rendering - Reflecting class java.lang.Object16:59:50.641 [main] DEBUG org.apache.velocity.rendering - Adding public final void java.lang.Object.wait() throws java.lang.InterruptedException16:59:50.641 [main] DEBUG org.apache.velocity.rendering - Adding public final void java.lang.Object.wait(long,int) throws java.lang.InterruptedException16:59:50.641 [main] DEBUG org.apache.velocity.rendering - Adding public final native void java.lang.Object.wait(long) throws java.lang.InterruptedException16:59:50.641 [main] DEBUG org.apache.velocity.rendering - Adding public final native java.lang.Class java.lang.Object.getClass()16:59:50.641 [main] DEBUG org.apache.velocity.rendering - Adding public final native void java.lang.Object.notify()16:59:50.641 [main] DEBUG org.apache.velocity.rendering - Adding public final native void java.lang.Object.notifyAll()16:59:50.641 [main] DEBUG org.apache.velocity.rendering - =================================================================16:59:50.645 [main] DEBUG org.apache.velocity.rendering - =================================================================16:59:50.646 [main] DEBUG org.apache.velocity.rendering - == Class: class java.lang.String16:59:50.646 [main] DEBUG org.apache.velocity.rendering - Reflecting class java.lang.String16:59:50.646 [main] DEBUG org.apache.velocity.rendering - Adding public boolean java.lang.String.equals(java.lang.Object)16:59:50.646 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.String java.lang.String.toString()16:59:50.646 [main] DEBUG org.apache.velocity.rendering - Adding public int java.lang.String.hashCode()16:59:50.646 [main] DEBUG org.apache.velocity.rendering - Adding public int java.lang.String.compareTo(java.lang.String)16:59:50.646 [main] DEBUG org.apache.velocity.rendering - Adding public int java.lang.String.compareTo(java.lang.Object)16:59:50.646 [main] DEBUG org.apache.velocity.rendering - Adding public int java.lang.String.indexOf(java.lang.String,int)16:59:50.646 [main] DEBUG org.apache.velocity.rendering - Adding public int java.lang.String.indexOf(java.lang.String)16:59:50.646 [main] DEBUG org.apache.velocity.rendering - Adding public int java.lang.String.indexOf(int,int)16:59:50.646 [main] DEBUG org.apache.velocity.rendering - Adding public int java.lang.String.indexOf(int)16:59:50.646 [main] DEBUG org.apache.velocity.rendering - Adding public static java.lang.String java.lang.String.valueOf(int)16:59:50.646 [main] DEBUG org.apache.velocity.rendering - Adding public static java.lang.String java.lang.String.valueOf(long)16:59:50.646 [main] DEBUG org.apache.velocity.rendering - Adding public static java.lang.String java.lang.String.valueOf(float)16:59:50.646 [main] DEBUG org.apache.velocity.rendering - Adding public static java.lang.String java.lang.String.valueOf(boolean)16:59:50.646 [main] DEBUG org.apache.velocity.rendering - Adding public static java.lang.String java.lang.String.valueOf(char[])16:59:50.646 [main] DEBUG org.apache.velocity.rendering - Adding public static java.lang.String java.lang.String.valueOf(char[],int,int)16:59:50.646 [main] DEBUG org.apache.velocity.rendering - Adding public static java.lang.String java.lang.String.valueOf(java.lang.Object)16:59:50.646 [main] DEBUG org.apache.velocity.rendering - Adding public static java.lang.String java.lang.String.valueOf(char)16:59:50.646 [main] DEBUG org.apache.velocity.rendering - Adding public static java.lang.String java.lang.String.valueOf(double)16:59:50.646 [main] DEBUG org.apache.velocity.rendering - Adding public char java.lang.String.charAt(int)16:59:50.646 [main] DEBUG org.apache.velocity.rendering - Adding public int java.lang.String.codePointAt(int)16:59:50.646 [main] DEBUG org.apache.velocity.rendering - Adding public int java.lang.String.codePointBefore(int)16:59:50.646 [main] DEBUG org.apache.velocity.rendering - Adding public int java.lang.String.codePointCount(int,int)16:59:50.646 [main] DEBUG org.apache.velocity.rendering - Adding public int java.lang.String.compareToIgnoreCase(java.lang.String)16:59:50.646 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.String java.lang.String.concat(java.lang.String)16:59:50.646 [main] DEBUG org.apache.velocity.rendering - Adding public boolean java.lang.String.contains(java.lang.CharSequence)16:59:50.646 [main] DEBUG org.apache.velocity.rendering - Adding public boolean java.lang.String.contentEquals(java.lang.CharSequence)16:59:50.647 [main] DEBUG org.apache.velocity.rendering - Adding public boolean java.lang.String.contentEquals(java.lang.StringBuffer)16:59:50.647 [main] DEBUG org.apache.velocity.rendering - Adding public static java.lang.String java.lang.String.copyValueOf(char[])16:59:50.647 [main] DEBUG org.apache.velocity.rendering - Adding public static java.lang.String java.lang.String.copyValueOf(char[],int,int)16:59:50.647 [main] DEBUG org.apache.velocity.rendering - Adding public boolean java.lang.String.endsWith(java.lang.String)16:59:50.647 [main] DEBUG org.apache.velocity.rendering - Adding public boolean java.lang.String.equalsIgnoreCase(java.lang.String)16:59:50.647 [main] DEBUG org.apache.velocity.rendering - Adding public static java.lang.String java.lang.String.format(java.util.Locale,java.lang.String,java.lang.Object[])16:59:50.647 [main] DEBUG org.apache.velocity.rendering - Adding public static java.lang.String java.lang.String.format(java.lang.String,java.lang.Object[])16:59:50.647 [main] DEBUG org.apache.velocity.rendering - Adding public void java.lang.String.getBytes(int,int,byte[],int)16:59:50.647 [main] DEBUG org.apache.velocity.rendering - Adding public byte[] java.lang.String.getBytes(java.nio.charset.Charset)16:59:50.647 [main] DEBUG org.apache.velocity.rendering - Adding public byte[] java.lang.String.getBytes(java.lang.String) throws java.io.UnsupportedEncodingException16:59:50.647 [main] DEBUG org.apache.velocity.rendering - Adding public byte[] java.lang.String.getBytes()16:59:50.647 [main] DEBUG org.apache.velocity.rendering - Adding public void java.lang.String.getChars(int,int,char[],int)16:59:50.647 [main] DEBUG org.apache.velocity.rendering - Adding public native java.lang.String java.lang.String.intern()16:59:50.647 [main] DEBUG org.apache.velocity.rendering - Adding public boolean java.lang.String.isEmpty()16:59:50.647 [main] DEBUG org.apache.velocity.rendering - Adding public static java.lang.String java.lang.String.join(java.lang.CharSequence,java.lang.CharSequence[])16:59:50.647 [main] DEBUG org.apache.velocity.rendering - Adding public static java.lang.String java.lang.String.join(java.lang.CharSequence,java.lang.Iterable)16:59:50.647 [main] DEBUG org.apache.velocity.rendering - Adding public int java.lang.String.lastIndexOf(int)16:59:50.647 [main] DEBUG org.apache.velocity.rendering - Adding public int java.lang.String.lastIndexOf(java.lang.String)16:59:50.647 [main] DEBUG org.apache.velocity.rendering - Adding public int java.lang.String.lastIndexOf(java.lang.String,int)16:59:50.647 [main] DEBUG org.apache.velocity.rendering - Adding public int java.lang.String.lastIndexOf(int,int)16:59:50.647 [main] DEBUG org.apache.velocity.rendering - Adding public int java.lang.String.length()16:59:50.647 [main] DEBUG org.apache.velocity.rendering - Adding public boolean java.lang.String.matches(java.lang.String)16:59:50.647 [main] DEBUG org.apache.velocity.rendering - Adding public int java.lang.String.offsetByCodePoints(int,int)16:59:50.647 [main] DEBUG org.apache.velocity.rendering - Adding public boolean java.lang.String.regionMatches(int,java.lang.String,int,int)16:59:50.647 [main] DEBUG org.apache.velocity.rendering - Adding public boolean java.lang.String.regionMatches(boolean,int,java.lang.String,int,int)16:59:50.647 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.String java.lang.String.replace(char,char)16:59:50.648 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.String java.lang.String.replace(java.lang.CharSequence,java.lang.CharSequence)16:59:50.648 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.String java.lang.String.replaceAll(java.lang.String,java.lang.String)16:59:50.648 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.String java.lang.String.replaceFirst(java.lang.String,java.lang.String)16:59:50.648 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.String[] java.lang.String.split(java.lang.String)16:59:50.648 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.String[] java.lang.String.split(java.lang.String,int)16:59:50.648 [main] DEBUG org.apache.velocity.rendering - Adding public boolean java.lang.String.startsWith(java.lang.String,int)16:59:50.648 [main] DEBUG org.apache.velocity.rendering - Adding public boolean java.lang.String.startsWith(java.lang.String)16:59:50.648 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.CharSequence java.lang.String.subSequence(int,int)16:59:50.648 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.String java.lang.String.substring(int)16:59:50.648 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.String java.lang.String.substring(int,int)16:59:50.648 [main] DEBUG org.apache.velocity.rendering - Adding public char[] java.lang.String.toCharArray()16:59:50.648 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.String java.lang.String.toLowerCase(java.util.Locale)16:59:50.648 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.String java.lang.String.toLowerCase()16:59:50.648 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.String java.lang.String.toUpperCase()16:59:50.648 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.String java.lang.String.toUpperCase(java.util.Locale)16:59:50.648 [main] DEBUG org.apache.velocity.rendering - Adding public java.lang.String java.lang.String.trim()16:59:50.648 [main] DEBUG org.apache.velocity.rendering - Reflecting interface java.io.Serializable16:59:50.648 [main] DEBUG org.apache.velocity.rendering - Reflecting interface java.lang.Comparable16:59:50.648 [main] DEBUG org.apache.velocity.rendering - Reflecting interface java.lang.CharSequence16:59:50.648 [main] DEBUG org.apache.velocity.rendering - Adding public default java.util.stream.IntStream java.lang.CharSequence.chars()16:59:50.648 [main] DEBUG org.apache.velocity.rendering - Adding public default java.util.stream.IntStream java.lang.CharSequence.codePoints()16:59:50.648 [main] DEBUG org.apache.velocity.rendering - Reflecting class java.lang.Object16:59:50.648 [main] DEBUG org.apache.velocity.rendering - Adding public final void java.lang.Object.wait() throws java.lang.InterruptedException16:59:50.648 [main] DEBUG org.apache.velocity.rendering - Adding public final void java.lang.Object.wait(long,int) throws java.lang.InterruptedException16:59:50.648 [main] DEBUG org.apache.velocity.rendering - Adding public final native void java.lang.Object.wait(long) throws java.lang.InterruptedException16:59:50.648 [main] DEBUG org.apache.velocity.rendering - Adding public final native java.lang.Class java.lang.Object.getClass()16:59:50.648 [main] DEBUG org.apache.velocity.rendering - Adding public final native void java.lang.Object.notify()16:59:50.648 [main] DEBUG org.apache.velocity.rendering - Adding public final native void java.lang.Object.notifyAll()16:59:50.648 [main] DEBUG org.apache.velocity.rendering - =================================================================16:59:50.651 [main] DEBUG com.baomidou.mybatisplus.generator.engine.AbstractTemplateEngine - 模板:/templates/entity.java.vm; 文件:D:WorkSpacemyweb-boot/src/main/javacomyinchdwebmodelTestModel.java16:59:50.653 [main] DEBUG org.apache.velocity.loader - ResourceManager: found /generator/mapper.java.vm with loader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader16:59:50.654 [main] DEBUG com.baomidou.mybatisplus.generator.engine.AbstractTemplateEngine - 模板:/generator/mapper.java.vm; 文件:D:WorkSpacemyweb-boot/src/main/javacomyinchdwebmapperTestMapper.java16:59:50.657 [main] DEBUG org.apache.velocity.loader - ResourceManager: found /templates/mapper.xml.vm with loader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader16:59:50.660 [main] DEBUG com.baomidou.mybatisplus.generator.engine.AbstractTemplateEngine - 模板:/templates/mapper.xml.vm; 文件:D:WorkSpacemyweb-boot/src/main/javacomyinchdwebmapperxmlTestMapper.xml16:59:50.662 [main] DEBUG org.apache.velocity.loader - ResourceManager: found /templates/service.java.vm with loader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader16:59:50.663 [main] DEBUG com.baomidou.mybatisplus.generator.engine.AbstractTemplateEngine - 模板:/templates/service.java.vm; 文件:D:WorkSpacemyweb-boot/src/main/javacomyinchdwebserviceTestService.java16:59:50.666 [main] DEBUG org.apache.velocity.loader - ResourceManager: found /templates/serviceImpl.java.vm with loader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader16:59:50.667 [main] DEBUG com.baomidou.mybatisplus.generator.engine.AbstractTemplateEngine - 模板:/templates/serviceImpl.java.vm; 文件:D:WorkSpacemyweb-boot/src/main/javacomyinchdwebserviceimplTestServiceImpl.java16:59:50.670 [main] DEBUG org.apache.velocity.loader - ResourceManager: found /templates/controller.java.vm with loader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader16:59:50.760 [main] DEBUG com.baomidou.mybatisplus.generator.engine.AbstractTemplateEngine - 模板:/templates/controller.java.vm; 文件:D:WorkSpacemyweb-boot/src/main/javacomyinchdwebcontrollerTestController.java16:59:50.760 [main] DEBUG com.baomidou.mybatisplus.generator.AutoGenerator - ==========================文件生成完成!!!==========================生成成功...Disconnected from the target VM, address: ’127.0.0.1:59499’, transport: ’socket’Process finished with exit code 0

来看下生成效果

成功生成文件到指定位置

Java实战之实现一个好用的MybatisPlus代码生成器

如果这里没有生成到指定目录,请按如下步骤检查

Java实战之实现一个好用的MybatisPlus代码生成器

检查下工作目录(Working directory)是不是在当前项目路径,如果不是,请改到项目目录下去

Java实战之实现一个好用的MybatisPlus代码生成器TestModel效果

package com.yinchd.web.model;import com.baomidou.mybatisplus.annotation.TableName;import com.baomidou.mybatisplus.annotation.IdType;import com.baomidou.mybatisplus.annotation.TableId;import java.time.LocalDateTime;import com.baomidou.mybatisplus.annotation.TableField;import java.io.Serializable;import io.swagger.annotations.ApiModel;import io.swagger.annotations.ApiModelProperty;import lombok.Data;import lombok.EqualsAndHashCode;import lombok.experimental.Accessors;/** * <p> * 测试表 * </p> * * @author yinchd * @since 2021-04-22 */@Data@EqualsAndHashCode(callSuper = false)@Accessors(chain = true)@TableName('t_test')@ApiModel(value='TestModel对象', description='测试表')public class TestModel implements Serializable { private static final long serialVersionUID = 1L; @ApiModelProperty(value = 'id主键') @TableId(value = 'id', type = IdType.AUTO) private Integer id; @ApiModelProperty(value = '名称') @TableField('name') private String name; @ApiModelProperty(value = '性别') @TableField('sex') private String sex; @ApiModelProperty(value = '爱好') @TableField('hobby') private String hobby; @ApiModelProperty(value = '手机号') @TableField('mobile') private String mobile; @ApiModelProperty(value = '创建时间') @TableField('create_time') private LocalDateTime createTime; public static final String ID = 'id'; public static final String NAME = 'name'; public static final String SEX = 'sex'; public static final String HOBBY = 'hobby'; public static final String MOBILE = 'mobile'; public static final String CREATE_TIME = 'create_time';}

TestController

package com.yinchd.web.controller;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.bind.annotation.RestController;/** * <p> * 测试表 前端控制器 * </p> * * @author yinchd * @since 2021-04-22 */@RestController@RequestMapping('/test-model')public class TestController {}

TestService

package com.yinchd.web.service;import com.yinchd.web.m

标签: Java
相关文章: