public class TableColumn extends Object
| コンストラクタと説明 |
|---|
TableColumn(Table table,
TableColumnMeta colMeta)
A TableColumn that's derived from something other than traditional database metadata
(e.g. defined in XML).
|
| 修飾子とタイプ | メソッドと説明 |
|---|---|
void |
addChild(TableColumn child,
ForeignKeyConstraint constraint)
Add a child column (FK) to this column (PK) via the associated constraint
|
void |
addParent(TableColumn parent,
ForeignKeyConstraint constraint)
Add a parent column (PK) to this column (FK) via the associated constraint
|
boolean |
allowsImpliedChildren()
Returns
true if this column is permitted to be a PK to an implied FK
(based on name/type/size matches to PKs). |
boolean |
allowsImpliedParents()
Returns
true if this column is permitted to be an implied FK
(based on name/type/size matches to PKs). |
ForeignKeyConstraint |
getChildConstraint(TableColumn child)
returns the constraint that connects the specified column to this column
(specified 'child' to this 'parent' column)
|
Set<TableColumn> |
getChildren()
Returns
Set of TableColumns that have a real (or implied) foreign key that
references this TableColumn. |
String |
getComments() |
int |
getDecimalDigits()
Decimal digits of the column.
|
Object |
getDefaultValue()
Returns the value that the database uses for this column if one isn't provided.
|
String |
getDetailedSize()
String representation of length with optional decimal digits (if decimal digits > 0).
|
Object |
getId()
Returns the ID of the column or
null if the database doesn't support the concept. |
int |
getLength()
Length of the column.
|
String |
getName()
Returns the column's name.
|
ForeignKeyConstraint |
getParentConstraint(TableColumn parent)
Returns the constraint that connects this column to the specified column (this 'child' column to specified 'parent' column)
|
Set<TableColumn> |
getParents()
|
Table |
getTable()
Returns the
Table that this column belongs to. |
String |
getType()
Type of the column.
|
boolean |
isAllExcluded()
Returns
true if this column is to be excluded from all relationships in
relationship diagrams. |
boolean |
isAutoUpdated()
|
boolean |
isExcluded()
Returns
true if this column is to be excluded from relationship diagrams. |
boolean |
isForeignKey()
Returns
true if this column points to another table's primary key. |
boolean |
isNullable()
Returns
true if null values are allowed |
boolean |
isPrimary()
Returns
true if this column is a primary key |
boolean |
isUnique()
Returns
true if this column can only contain unique values |
boolean |
matches(Pattern regex)
Returns
true if tableName.columnName matches the supplied
regular expression. |
ForeignKeyConstraint |
removeAChildFKConstraint()
Remove one child
ForeignKeyConstraint that points to this column. |
ForeignKeyConstraint |
removeAParentFKConstraint()
Removes a parent constraint and returns it, or null if there are no parent constraints
|
void |
removeChild(TableColumn child)
Remove the specified child column from this column
|
void |
removeParent(TableColumn parent)
Remove the specified parent column from this column
|
void |
setComments(String comments)
See
getComments() |
void |
setIsAutoUpdated(boolean isAutoUpdated)
setIsAutoUpdated
|
String |
toString()
Returns the name of this column.
|
void |
unlinkChildren()
Disassociate all children from this column
|
void |
unlinkParents()
Disassociate all parents from this column
|
void |
update(TableColumnMeta colMeta)
Update the state of this column with the supplied
TableColumnMeta. |
public TableColumn(Table table, TableColumnMeta colMeta)
table - colMeta - public String getName()
public Object getId()
null if the database doesn't support the concept.public String getType()
DatabaseMetaData.getColumns(String, String, String, String)'s TYPE_NAME.public int getLength()
DatabaseMetaData.getColumns(String, String, String, String)'s BUFFER_LENGTH,
or if that's null, COLUMN_SIZE.public int getDecimalDigits()
DatabaseMetaData.getColumns(String, String, String, String)'s DECIMAL_DIGITS.public String getDetailedSize()
public boolean isNullable()
true if null values are allowedpublic boolean isAutoUpdated()
public void setIsAutoUpdated(boolean isAutoUpdated)
isAutoUpdated - booleanpublic boolean isUnique()
true if this column can only contain unique valuespublic boolean isPrimary()
true if this column is a primary keypublic boolean isForeignKey()
true if this column points to another table's primary key.public Object getDefaultValue()
public String getComments()
null if none.public void setComments(String comments)
getComments()comments - public boolean isExcluded()
true if this column is to be excluded from relationship diagrams.
Unless isAllExcluded() is true this column will be included in the detailed
diagrams of the containing table.
This is typically an attempt to reduce clutter that can be introduced when many tables reference a given column.
public boolean isAllExcluded()
true if this column is to be excluded from all relationships in
relationship diagrams. This includes the detailed diagrams of the containing table.
This is typically an attempt to reduce clutter that can be introduced when many tables reference a given column.
public void addParent(TableColumn parent, ForeignKeyConstraint constraint)
parent - constraint - public void removeParent(TableColumn parent)
parent - public void unlinkParents()
public Set<TableColumn> getParents()
public ForeignKeyConstraint getParentConstraint(TableColumn parent)
public ForeignKeyConstraint removeAParentFKConstraint()
ForeignKeyConstraintpublic ForeignKeyConstraint removeAChildFKConstraint()
ForeignKeyConstraint that points to this column.null if none were available to be removedpublic void addChild(TableColumn child, ForeignKeyConstraint constraint)
child - constraint - public void removeChild(TableColumn child)
child - public void unlinkChildren()
public Set<TableColumn> getChildren()
Set of TableColumns that have a real (or implied) foreign key that
references this TableColumn.public ForeignKeyConstraint getChildConstraint(TableColumn child)
public boolean matches(Pattern regex)
true if tableName.columnName matches the supplied
regular expression.regex - public void update(TableColumnMeta colMeta)
TableColumnMeta.
Intended to be used with instances created by TableColumn(Table, TableColumnMeta).colMeta - public boolean allowsImpliedParents()
true if this column is permitted to be an implied FK
(based on name/type/size matches to PKs).public boolean allowsImpliedChildren()
true if this column is permitted to be a PK to an implied FK
(based on name/type/size matches to PKs).Copyright © 2016. All Rights Reserved.