mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-06 16:48:24 +08:00
refactor: add rawType and rawLength properties for Column.java
This commit is contained in:
parent
1da3869dbd
commit
c9bc421937
@ -25,6 +25,7 @@ import java.util.Map;
|
||||
|
||||
/**
|
||||
* 默认方言抽象类。
|
||||
* @author michael
|
||||
*/
|
||||
public abstract class JdbcDialect implements IDialect {
|
||||
|
||||
@ -42,6 +43,9 @@ public abstract class JdbcDialect implements IDialect {
|
||||
Column column = new Column();
|
||||
column.setName(columnMetaData.getColumnName(i));
|
||||
|
||||
column.setRawType(columnMetaData.getColumnTypeName(i));
|
||||
column.setRawLength(columnMetaData.getColumnDisplaySize(i));
|
||||
|
||||
String jdbcType = columnMetaData.getColumnClassName(i);
|
||||
column.setPropertyType(JdbcTypeMapping.getType(jdbcType));
|
||||
|
||||
|
||||
@ -21,9 +21,7 @@ import com.mybatisflex.annotation.KeyType;
|
||||
import com.mybatisflex.codegen.config.ColumnConfig;
|
||||
import com.mybatisflex.core.util.StringUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
@ -71,6 +69,16 @@ public class Column {
|
||||
*/
|
||||
private boolean needGenColumnAnnotation = false;
|
||||
|
||||
/**
|
||||
* 数据库的字段类型,比如 varchar/tinyint 等
|
||||
*/
|
||||
private String rawType;
|
||||
|
||||
/**
|
||||
* 数据库中的字段长度,比如 varchar(32) 中的 32
|
||||
*/
|
||||
private int rawLength;
|
||||
|
||||
/**
|
||||
* 字段配置。
|
||||
*/
|
||||
@ -145,6 +153,22 @@ public class Column {
|
||||
isAutoIncrement = autoIncrement;
|
||||
}
|
||||
|
||||
public String getRawType() {
|
||||
return rawType;
|
||||
}
|
||||
|
||||
public void setRawType(String rawType) {
|
||||
this.rawType = rawType;
|
||||
}
|
||||
|
||||
public int getRawLength() {
|
||||
return rawLength;
|
||||
}
|
||||
|
||||
public void setRawLength(int rawLength) {
|
||||
this.rawLength = rawLength;
|
||||
}
|
||||
|
||||
public ColumnConfig getColumnConfig() {
|
||||
return columnConfig;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user