public class Column extends Object implements Serializable, Cloneable
| Constructor and Description |
|---|
Column()
构造
|
Column(Table table,
ResultSet columnMetaRs)
构造
|
| Modifier and Type | Method and Description |
|---|---|
Column |
clone() |
String |
getColumnDef()
获取默认值
|
Integer |
getDigit()
获取小数位数
|
String |
getName()
获取列名
|
int |
getOrder()
获取顺序号
|
String |
getRemarks()
获取注释
|
long |
getSize()
获取大小或数据长度
|
String |
getTableName()
获取表名
|
int |
getType()
获取类型,对应
Types中的类型 |
JdbcType |
getTypeEnum()
获取字段类型的枚举
|
String |
getTypeName()
获取类型名称
|
void |
init(Table table,
ResultSet columnMetaRs)
初始化
|
boolean |
isAutoIncrement()
是否自增
|
boolean |
isNullable()
是否为可空
|
boolean |
isPk()
是否主键
|
static Column |
of(Table table,
ResultSet columnMetaRs)
创建列对象
|
Column |
setAutoIncrement(boolean autoIncrement)
设置是否自增
|
Column |
setColumnDef(String columnDef)
设置默认值
|
Column |
setDigit(int digit)
设置小数位数
|
Column |
setName(String name)
设置列名
|
Column |
setNullable(boolean isNullable)
设置是否为可空
|
Column |
setOrder(int order)
设置顺序号
|
Column |
setPk(boolean isPk)
设置是否主键
|
Column |
setRemarks(String remarks)
设置注释
|
Column |
setSize(long size)
设置大小或数据长度
|
Column |
setTableName(String tableName)
设置表名
|
Column |
setType(int type)
设置类型,对应java.sql.Types中的类型
|
Column |
setTypeName(String typeName)
设置类型名称
|
String |
toString() |
public static Column of(Table table, ResultSet columnMetaRs)
columnMetaRs - 列元信息的ResultSettable - 表信息public void init(Table table, ResultSet columnMetaRs) throws SQLException
table - 表信息columnMetaRs - 列的meta ResultSetSQLException - SQL执行异常public String getTableName()
public Column setTableName(String tableName)
tableName - 表名public String getName()
public JdbcType getTypeEnum()
public int getType()
Types中的类型public Column setType(int type)
type - 类型public String getTypeName()
public Column setTypeName(String typeName)
typeName - 类型名称public long getSize()
public Column setSize(long size)
size - 大小或数据长度public Integer getDigit()
public Column setDigit(int digit)
digit - 小数位数public boolean isNullable()
public Column setNullable(boolean isNullable)
isNullable - 是否为可空public String getRemarks()
public boolean isAutoIncrement()
public Column setAutoIncrement(boolean autoIncrement)
autoIncrement - 是否自增public String getColumnDef()
public Column setColumnDef(String columnDef)
columnDef - 默认值public boolean isPk()
public Column setPk(boolean isPk)
isPk - 是否主键public int getOrder()
public Column setOrder(int order)
order - 顺序号public Column clone() throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedExceptionCopyright © 2024. All rights reserved.