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() |
static Column |
create(Table table,
ResultSet columnMetaRs)
创建列对象
|
String |
getColumnDef()
获取默认值
|
String |
getComment()
获取注释
|
Integer |
getDigit()
获取小数位数
|
String |
getName()
获取列名
|
long |
getSize()
获取大小或数据长度
|
String |
getTableName()
获取表名
|
int |
getType()
获取类型,对应
Types 中的类型 |
JdbcType |
getTypeEnum()
获取字段类型的枚举
|
String |
getTypeName()
获取类型名称
|
void |
init(Table table,
ResultSet columnMetaRs)
初始化
|
boolean |
isAutoIncrement()
是否自增
|
boolean |
isNullable()
是否为可空
|
boolean |
isPk()
是否主键
|
Column |
setAutoIncrement(boolean autoIncrement)
设置是否自增
|
Column |
setColumnDef(String columnDef)
设置默认值
|
Column |
setComment(String comment)
设置注释
|
Column |
setDigit(int digit)
设置小数位数
|
Column |
setName(String name)
设置列名
|
Column |
setNullable(boolean isNullable)
设置是否为可空
|
Column |
setPk(boolean isPk)
设置是否主键
|
Column |
setSize(int size)
设置大小或数据长度
|
Column |
setTableName(String tableName)
设置表名
|
Column |
setType(int type)
设置类型,对应java.sql.Types中的类型
|
Column |
setTypeName(String typeName)
设置类型名称
|
String |
toString() |
public static Column create(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(int size)
size
- 大小或数据长度public Integer getDigit()
public Column setDigit(int digit)
digit
- 小数位数public boolean isNullable()
public Column setNullable(boolean isNullable)
isNullable
- 是否为可空public String getComment()
public boolean isAutoIncrement()
public Column setAutoIncrement(boolean autoIncrement)
autoIncrement
- 是否自增public boolean isPk()
public Column setPk(boolean isPk)
isPk
- 是否主键public String getColumnDef()
public Column setColumnDef(String columnDef)
columnDef
- 默认值public Column clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
Copyright © 2024. All rights reserved.