mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-08 01:28:24 +08:00
feat: add 代码生成器 ColumnConfig 增加 propertyType. 可以用于自定通用属性的类型。
This commit is contained in:
parent
86544fca9c
commit
86525f16e1
@ -60,6 +60,10 @@ public class ColumnConfig implements Serializable {
|
||||
* 配置的 jdbcType。
|
||||
*/
|
||||
private JdbcType jdbcType;
|
||||
/**
|
||||
* 属性的类型。
|
||||
*/
|
||||
private Class<?> propertyType;
|
||||
|
||||
/**
|
||||
* 自定义 TypeHandler。
|
||||
@ -207,5 +211,11 @@ public class ColumnConfig implements Serializable {
|
||||
public void setTenantId(Boolean tenantId) {
|
||||
this.tenantId = tenantId;
|
||||
}
|
||||
|
||||
public Class<?> getPropertyType() {
|
||||
return propertyType;
|
||||
}
|
||||
|
||||
public void setPropertyType(Class<?> propertyType) {
|
||||
this.propertyType = propertyType;
|
||||
}
|
||||
}
|
||||
|
||||
@ -93,8 +93,13 @@ public class Column {
|
||||
}
|
||||
|
||||
public String getPropertySimpleType() {
|
||||
if (columnConfig.getPropertyType()!=null){
|
||||
return columnConfig.getPropertyType().getSimpleName();
|
||||
}
|
||||
else {
|
||||
return propertyType.substring(propertyType.lastIndexOf(".") + 1);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPropertyType(String propertyType) {
|
||||
this.propertyType = propertyType;
|
||||
@ -291,6 +296,9 @@ public class Column {
|
||||
}
|
||||
|
||||
if (columnConfig != null) {
|
||||
if (columnConfig.getPropertyType() !=null){
|
||||
importClasses.add(columnConfig.getPropertyType().getName());
|
||||
}
|
||||
if (columnConfig.getMask() != null) {
|
||||
importClasses.add(ColumnMask.class.getName());
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user