public class TableColumn extends Object
Constructor and Description |
---|
TableColumn()
Creates a new table column.
|
TableColumn(Property property,
int sqlType)
Creates a new table column which is pre-initialized with the given property and type.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
String |
getDefaultValue()
Returns the default value as string.
|
int |
getLength()
Returns the overall max. length of the column.
|
String |
getName()
Returns the name of the column.
|
String |
getOldName()
Returns the old name of the column.
|
int |
getPrecision()
Returns the precision of the column.
|
int |
getScale()
Returns the number decimal places after the comma.
|
Property |
getSource()
Returns the underlying property if available
|
int |
getType()
Returns the JDBC type of the column.
|
int |
hashCode() |
boolean |
isAutoIncrement()
Determines whether auto inctement is enabled for this column.
|
boolean |
isNullable()
Determines the nullability of the column.
|
void |
setAutoIncrement(boolean autoIncrement)
Sets the auto increment flag of this column
|
void |
setDefaultValue(String defaultValue)
Specifies the default value.
|
void |
setLength(int length)
Specifies the max. length of the column.
|
void |
setName(String name)
Sets the name of the column.
|
void |
setNullable(boolean nullable)
Specifies the nullability of the column.
|
void |
setOldName(String oldName)
Set the old name of a column.
|
void |
setPrecision(int precision)
Specifies a precision of the column.
|
void |
setScale(int scale)
Specifies the number of decimal places.
|
void |
setType(int type)
Sets the JDBC type of the column.
|
String |
toString() |
public TableColumn()
public TableColumn(Property property, int sqlType)
property
- the property used to determine common parameters (nullability, length, default value ..)sqlType
- the type of the column based on Types
@Nullable public Property getSource()
public boolean isAutoIncrement()
public void setAutoIncrement(boolean autoIncrement)
autoIncrement
- true if this is an auto increment column, false otherwise.public String getOldName()
public void setOldName(String oldName)
oldName
- the previous name of the columnpublic String getName()
public void setName(String name)
name
- the name of the columnpublic int getType()
Types
public void setType(int type)
type
- the type to setTypes
public boolean isNullable()
public void setNullable(boolean nullable)
nullable
- true if the column may be null, false otherwisepublic int getLength()
public void setLength(int length)
length
- the max length of this columnpublic int getPrecision()
public void setPrecision(int precision)
precision
- the total number of digits which can be stored withozt rounding errors.public int getScale()
public void setScale(int scale)
scale
- the number of decimal places after the commapublic String getDefaultValue()
public void setDefaultValue(String defaultValue)
defaultValue
- the default value as stringCopyright © 2018. All rights reserved.