mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-07 00:58:24 +08:00
将ColumnConfig的propertyType的类型改为String,使其支持原始类型
ColumnConfig添加propertyDefaultValue属性,支持为生成的实体类的属性添加默认值 补充对应文档。
This commit is contained in:
parent
10d2080a94
commit
91e503ba74
@ -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 驱动的数据类型为自定义的
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user