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()
获取注释
|
String |
getTableName()
获取表名
|
ColumnType |
getType()
获取数据库字段类型,包括长度
|
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(Integer digit)
设置小数位数
|
Column |
setName(String name)
设置列名
|
Column |
setNullable(boolean isNullable)
设置是否为可空
|
Column |
setOrder(int order)
设置顺序号
|
Column |
setPk(boolean isPk)
设置是否主键
|
Column |
setRemarks(String remarks)
设置注释
|
Column |
setTableName(String tableName)
设置表名
|
Column |
setType(ColumnType type)
设置数据库字段类型,包括长度
|
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 ColumnType getType()
public Column setType(ColumnType type)
type
- 数据库字段类型,包括长度public Integer getDigit()
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 Object
CloneNotSupportedException
Copyright © 2025. All rights reserved.