将ColumnConfig的propertyType的类型改为String,使其支持原始类型

ColumnConfig添加propertyDefaultValue属性,支持为生成的实体类的属性添加默认值
补充对应文档。
This commit is contained in:
zack 2023-07-25 22:29:23 +08:00
parent 10d2080a94
commit 91e503ba74
2 changed files with 18 additions and 4 deletions

View File

@ -449,9 +449,22 @@ public class ColumnConfig implements Serializable {
// 是否是租户列 // 是否是租户列
private Boolean tenantId; 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 驱动的数据类型为自定义的 MyBatis-Flex 内置了一个名为:`JdbcTypeMapping` 的 java 类,我们可以用其配置映射 Jdbc 驱动的数据类型为自定义的

View File

@ -60,8 +60,9 @@ public class ColumnConfig implements Serializable {
* 配置的 jdbcType * 配置的 jdbcType
*/ */
private JdbcType jdbcType; private JdbcType jdbcType;
/** /**
* 属性的类型原始类型直接写类型名称int/long/float/double/boolean对象类型请写对应类的全限定名 * 属性的类型
*/ */
private String propertyType; private String propertyType;
@ -216,14 +217,14 @@ public class ColumnConfig implements Serializable {
public void setTenantId(Boolean tenantId) { public void setTenantId(Boolean tenantId) {
this.tenantId = tenantId; this.tenantId = tenantId;
} }
public Class<?> getPropertyType() {
return propertyType;
}
public String getPropertyType() { public String getPropertyType() {
return propertyType; return propertyType;
} }
/**
* 原始类型直接写类型名称int/long/float/double/boolean对象类型请写对应类的全限定名java.lang.String
*/
public void setPropertyType(String propertyType) { public void setPropertyType(String propertyType) {
this.propertyType = propertyType; this.propertyType = propertyType;
} }