diff --git a/docs/zh/others/codegen.md b/docs/zh/others/codegen.md index 5115848e..a222813d 100644 --- a/docs/zh/others/codegen.md +++ b/docs/zh/others/codegen.md @@ -449,9 +449,22 @@ public class ColumnConfig implements Serializable { // 是否是租户列 private Boolean tenantId; + + /** + * 属性的类型。 + * 原始类型直接写类型名称,例:int/long/float/double/boolean + * 对象类型请写对应类的全限定名,例:java.lang.String/com.abc.def.enums.Gender + */ + private String propertyType; + + /** + * 属性的默认值, 例:long类型默认值:0L,枚举类型默认值:Gender.MALE + */ + private String propertyDefaultValue; } ``` + ## 自定义属性类型 MyBatis-Flex 内置了一个名为:`JdbcTypeMapping` 的 java 类,我们可以用其配置映射 Jdbc 驱动的数据类型为自定义的 diff --git a/mybatis-flex-codegen/src/main/java/com/mybatisflex/codegen/config/ColumnConfig.java b/mybatis-flex-codegen/src/main/java/com/mybatisflex/codegen/config/ColumnConfig.java index 7bb50eee..2352fc86 100644 --- a/mybatis-flex-codegen/src/main/java/com/mybatisflex/codegen/config/ColumnConfig.java +++ b/mybatis-flex-codegen/src/main/java/com/mybatisflex/codegen/config/ColumnConfig.java @@ -60,8 +60,9 @@ public class ColumnConfig implements Serializable { * 配置的 jdbcType。 */ private JdbcType jdbcType; + /** - * 属性的类型。原始类型直接写类型名称:int/long/float/double/boolean,对象类型请写对应类的全限定名: + * 属性的类型。 */ private String propertyType; @@ -216,14 +217,14 @@ public class ColumnConfig implements Serializable { public void setTenantId(Boolean tenantId) { this.tenantId = tenantId; } - public Class getPropertyType() { - return propertyType; - } public String getPropertyType() { return propertyType; } + /** + * 原始类型直接写类型名称,例:int/long/float/double/boolean,对象类型请写对应类的全限定名,例:java.lang.String + */ public void setPropertyType(String propertyType) { this.propertyType = propertyType; }