diff --git a/mybatis-flex-codegen/src/main/java/com/mybatisflex/codegen/Generator.java b/mybatis-flex-codegen/src/main/java/com/mybatisflex/codegen/Generator.java index 65af4dde..547cd610 100644 --- a/mybatis-flex-codegen/src/main/java/com/mybatisflex/codegen/Generator.java +++ b/mybatis-flex-codegen/src/main/java/com/mybatisflex/codegen/Generator.java @@ -100,7 +100,7 @@ public class Generator { table.setName(tableName); String remarks = rs.getString("REMARKS"); - table.setRemarks(remarks); + table.setComment(remarks); buildPrimaryKey(table); diff --git a/mybatis-flex-codegen/src/main/java/com/mybatisflex/codegen/config/JavadocConfig.java b/mybatis-flex-codegen/src/main/java/com/mybatisflex/codegen/config/JavadocConfig.java index 5c25940a..85b81850 100644 --- a/mybatis-flex-codegen/src/main/java/com/mybatisflex/codegen/config/JavadocConfig.java +++ b/mybatis-flex-codegen/src/main/java/com/mybatisflex/codegen/config/JavadocConfig.java @@ -27,7 +27,7 @@ public class JavadocConfig { /** * 表名格式化。 */ - private Function tableRemarkFormat = Function.identity(); + private Function tableCommentFormat = Function.identity(); public String getAuthor() { return author; @@ -53,15 +53,15 @@ public class JavadocConfig { } public String formatTableComment(String comment) { - return tableRemarkFormat.apply(comment); + return tableCommentFormat.apply(comment); } - public Function getTableRemarkFormat() { - return tableRemarkFormat; + public Function getTableCommentFormat() { + return tableCommentFormat; } - public JavadocConfig setTableRemarkFormat(Function tableRemarkFormat) { - this.tableRemarkFormat = tableRemarkFormat; + public JavadocConfig setTableCommentFormat(Function tableCommentFormat) { + this.tableCommentFormat = tableCommentFormat; return this; } diff --git a/mybatis-flex-codegen/src/main/java/com/mybatisflex/codegen/dialect/JdbcDialect.java b/mybatis-flex-codegen/src/main/java/com/mybatisflex/codegen/dialect/JdbcDialect.java index 686fc2bb..33bacbe3 100644 --- a/mybatis-flex-codegen/src/main/java/com/mybatisflex/codegen/dialect/JdbcDialect.java +++ b/mybatis-flex-codegen/src/main/java/com/mybatisflex/codegen/dialect/JdbcDialect.java @@ -45,7 +45,7 @@ public abstract class JdbcDialect implements IDialect { column.setAutoIncrement(columnMetaData.isAutoIncrement(i)); //注释 - column.setRemarks(columnRemarks.get(column.getName())); + column.setComment(columnRemarks.get(column.getName())); table.addColumn(column); } diff --git a/mybatis-flex-codegen/src/main/java/com/mybatisflex/codegen/entity/Column.java b/mybatis-flex-codegen/src/main/java/com/mybatisflex/codegen/entity/Column.java index 614e5746..6daef109 100644 --- a/mybatis-flex-codegen/src/main/java/com/mybatisflex/codegen/entity/Column.java +++ b/mybatis-flex-codegen/src/main/java/com/mybatisflex/codegen/entity/Column.java @@ -30,7 +30,7 @@ public class Column { private String property; private String propertyType; - private String remarks; + private String comment; private boolean isPrimaryKey = false; private Boolean isAutoIncrement; @@ -63,12 +63,12 @@ public class Column { this.propertyType = propertyType; } - public String getRemarks() { - return remarks; + public String getComment() { + return comment; } - public void setRemarks(String remarks) { - this.remarks = remarks; + public void setComment(String comment) { + this.comment = comment; } public boolean isPrimaryKey() { @@ -104,12 +104,12 @@ public class Column { } - public String buildRemarks(){ - if (StringUtil.isBlank(remarks)){ + public String buildComment(){ + if (StringUtil.isBlank(comment)){ return ""; }else { StringBuilder sb = new StringBuilder("/**\n") - .append(" * ").append(remarks).append("\n") + .append(" * ").append(comment).append("\n") .append(" */"); return sb.toString(); } @@ -280,7 +280,7 @@ public class Column { return "Column{" + "name='" + name + '\'' + ", className='" + propertyType + '\'' + - ", remarks='" + remarks + '\'' + + ", remarks='" + comment + '\'' + ", isAutoIncrement=" + isAutoIncrement + '}'; } diff --git a/mybatis-flex-codegen/src/main/java/com/mybatisflex/codegen/entity/Table.java b/mybatis-flex-codegen/src/main/java/com/mybatisflex/codegen/entity/Table.java index 263f3cc5..001b0005 100644 --- a/mybatis-flex-codegen/src/main/java/com/mybatisflex/codegen/entity/Table.java +++ b/mybatis-flex-codegen/src/main/java/com/mybatisflex/codegen/entity/Table.java @@ -25,7 +25,7 @@ import java.util.stream.Collectors; public class Table { private String name; - private String remarks; + private String comment; private Set primaryKeys; private List columns = new ArrayList<>(); @@ -40,12 +40,12 @@ public class Table { this.name = name; } - public String getRemarks() { - return globalConfig.getJavadocConfig().formatTableComment(remarks); + public String getComment() { + return globalConfig.getJavadocConfig().formatTableComment(comment); } - public void setRemarks(String remarks) { - this.remarks = remarks; + public void setComment(String comment) { + this.comment = comment; } @@ -295,7 +295,7 @@ public class Table { public String toString() { return "Table{" + "name='" + name + '\'' + - ", remarks='" + remarks + '\'' + + ", remarks='" + comment + '\'' + ", primaryKeys='" + primaryKeys + '\'' + ", columns=" + columns + '}'; diff --git a/mybatis-flex-codegen/src/main/resources/templates/enjoy/controller.tpl b/mybatis-flex-codegen/src/main/resources/templates/enjoy/controller.tpl index 15f49655..338c0811 100644 --- a/mybatis-flex-codegen/src/main/resources/templates/enjoy/controller.tpl +++ b/mybatis-flex-codegen/src/main/resources/templates/enjoy/controller.tpl @@ -11,7 +11,7 @@ import #(controllerConfig.buildSuperClassImport()) #end /** - * #(table.getRemarks()) 控制层。 + * #(table.getComment()) 控制层。 * * @author #(javadocConfig.getAuthor()) * @since #(javadocConfig.getSince()) diff --git a/mybatis-flex-codegen/src/main/resources/templates/enjoy/entity.tpl b/mybatis-flex-codegen/src/main/resources/templates/enjoy/entity.tpl index 74621465..14fbd65b 100644 --- a/mybatis-flex-codegen/src/main/resources/templates/enjoy/entity.tpl +++ b/mybatis-flex-codegen/src/main/resources/templates/enjoy/entity.tpl @@ -5,7 +5,7 @@ import #(importClass); #end /** - * #(table.getRemarks()) 实体类。 + * #(table.getComment()) 实体类。 * * @author #(javadocConfig.getAuthor()) * @since #(javadocConfig.getSince()) @@ -14,7 +14,7 @@ import #(importClass); public class #(table.buildEntityClassName())#(table.buildExtends())#(table.buildImplements()) { #for(column: table.columns) - #(column.buildRemarks()) + #(column.buildComment()) #(column.buildAnnotations())private #(column.propertySimpleType) #(column.property); #end diff --git a/mybatis-flex-codegen/src/main/resources/templates/enjoy/mapper.tpl b/mybatis-flex-codegen/src/main/resources/templates/enjoy/mapper.tpl index 724c81bc..24040c98 100644 --- a/mybatis-flex-codegen/src/main/resources/templates/enjoy/mapper.tpl +++ b/mybatis-flex-codegen/src/main/resources/templates/enjoy/mapper.tpl @@ -4,7 +4,7 @@ import #(mapperConfig.buildSuperClassImport()); import #(packageConfig.entityPackage).#(table.buildEntityClassName()); /** - * #(table.getRemarks()) 映射层。 + * #(table.getComment()) 映射层。 * * @author #(javadocConfig.getAuthor()) * @since #(javadocConfig.getSince()) diff --git a/mybatis-flex-codegen/src/main/resources/templates/enjoy/service.tpl b/mybatis-flex-codegen/src/main/resources/templates/enjoy/service.tpl index 678cf3a5..79d3909a 100644 --- a/mybatis-flex-codegen/src/main/resources/templates/enjoy/service.tpl +++ b/mybatis-flex-codegen/src/main/resources/templates/enjoy/service.tpl @@ -4,7 +4,7 @@ import #(serviceConfig.buildSuperClassImport()); import #(packageConfig.entityPackage).#(table.buildEntityClassName()); /** - * #(table.getRemarks()) 服务层。 + * #(table.getComment()) 服务层。 * * @author #(javadocConfig.getAuthor()) * @since #(javadocConfig.getSince()) diff --git a/mybatis-flex-codegen/src/main/resources/templates/enjoy/serviceImpl.tpl b/mybatis-flex-codegen/src/main/resources/templates/enjoy/serviceImpl.tpl index a2dcdf11..c5b45e48 100644 --- a/mybatis-flex-codegen/src/main/resources/templates/enjoy/serviceImpl.tpl +++ b/mybatis-flex-codegen/src/main/resources/templates/enjoy/serviceImpl.tpl @@ -7,7 +7,7 @@ import #(packageConfig.servicePackage).#(table.buildServiceClassName()); import org.springframework.stereotype.Service; /** - * #(table.getRemarks()) 服务层实现。 + * #(table.getComment()) 服务层实现。 * * @author #(javadocConfig.getAuthor()) * @since #(javadocConfig.getSince()) diff --git a/mybatis-flex-codegen/src/main/resources/templates/enjoy/tableDef.tpl b/mybatis-flex-codegen/src/main/resources/templates/enjoy/tableDef.tpl index 23b5f031..513eaca2 100644 --- a/mybatis-flex-codegen/src/main/resources/templates/enjoy/tableDef.tpl +++ b/mybatis-flex-codegen/src/main/resources/templates/enjoy/tableDef.tpl @@ -4,7 +4,7 @@ import com.mybatisflex.core.query.QueryColumn; import com.mybatisflex.core.table.TableDef; /** - * #(table.getRemarks()) 表定义层。 + * #(table.getComment()) 表定义层。 * * @author #(javadocConfig.getAuthor()) * @since #(javadocConfig.getSince()) diff --git a/mybatis-flex-codegen/src/test/java/com/mybatisflex/codegen/test/GeneratorTest.java b/mybatis-flex-codegen/src/test/java/com/mybatisflex/codegen/test/GeneratorTest.java index 5b0475f3..24d51ba7 100644 --- a/mybatis-flex-codegen/src/test/java/com/mybatisflex/codegen/test/GeneratorTest.java +++ b/mybatis-flex-codegen/src/test/java/com/mybatisflex/codegen/test/GeneratorTest.java @@ -103,7 +103,7 @@ public class GeneratorTest { //设置注解生成配置 globalConfig.getJavadocConfig() .setAuthor("王帅") - .setTableRemarkFormat(format); + .setTableCommentFormat(format); //设置生成文件目录和根包 globalConfig.getPackageConfig()