public class Table extends Object implements Serializable
| Constructor and Description |
|---|
Table() |
| Modifier and Type | Method and Description |
|---|---|
void |
addColumn(Column column)
Adds the given column.
|
void |
addColumn(Column previousColumn,
Column column)
Adds the column after the given previous column.
|
void |
addColumn(int idx,
Column column)
Adds the given column at the specified position.
|
void |
addColumns(Collection columns)
Adds the given columns.
|
void |
addForeignKey(ForeignKey foreignKey)
Adds the given foreign key.
|
void |
addForeignKey(int idx,
ForeignKey foreignKey)
Adds the given foreign key at the specified position.
|
void |
addForeignKeys(Collection foreignKeys)
Adds the given foreign keys.
|
void |
addIndex(Index index)
Adds the given index.
|
void |
addIndex(int idx,
Index index)
Adds the given index at the specified position.
|
void |
addIndices(Collection indices)
Adds the given indices.
|
boolean |
equals(Object obj) |
Column |
findColumn(String name)
Finds the column with the specified name, using case insensitive matching.
|
Column |
findColumn(String name,
boolean caseSensitive)
Finds the column with the specified name, using case insensitive matching.
|
ForeignKey |
findForeignKey(ForeignKey key)
Finds the foreign key in this table that is equal to the supplied foreign key.
|
ForeignKey |
findForeignKey(ForeignKey key,
boolean caseSensitive)
Finds the foreign key in this table that is equal to the supplied foreign key.
|
ForeignKey |
findForeignKey(String name)
Finds the foreign key with the specified name, using case insensitive matching.
|
ForeignKey |
findForeignKey(String name,
boolean caseSensitive)
Finds the foreign key with the specified name, using case sensitive or insensitive
matching depending on the
caseSensitive parameter. |
Index |
findIndex(String name)
Finds the index with the specified name, using case insensitive matching.
|
Index |
findIndex(String name,
boolean caseSensitive)
Finds the index with the specified name, using case sensitive or insensitive
matching depending on the
caseSensitive parameter. |
Column[] |
getAutoIncrementColumns()
Returns the auto increment columns in this table.
|
String |
getCatalog()
Returns the catalog of this table as read from the database.
|
Column |
getColumn(int idx)
Returns the column at the specified position.
|
int |
getColumnCount()
Returns the number of columns in this table.
|
int |
getColumnIndex(Column column)
Determines the index of the given column.
|
Column[] |
getColumns()
Returns the columns in this table.
|
void |
getDelimitedName(StringBuilder query,
String delimiterToken) |
String |
getDescription()
Returns the description of the table.
|
ForeignKey |
getForeignKey(int idx)
Returns the foreign key at the given position.
|
int |
getForeignKeyCount()
Returns the number of foreign keys.
|
ForeignKey[] |
getForeignKeys()
Returns the foreign keys of this table.
|
Index |
getIndex(int idx)
Returns the index at the specified position.
|
int |
getIndexCount()
Returns the number of indices.
|
Index[] |
getIndices()
Returns the indices of this table.
|
String |
getName()
Returns the name of the table.
|
Index[] |
getNonUniqueIndices()
Gets a list of non-unique indices on this table.
|
String[] |
getPrimaryKeyColumnNames()
Returns the names of the primary key columns of this table.
|
Column[] |
getPrimaryKeyColumns()
Returns the primary key columns of this table.
|
String |
getQualifiedName()
Returns the qualified name of the table prepending the schema, if any.
|
Column[] |
getRequiredColumns()
Returns the required (not-nullable) columns in this table.
|
String |
getSchema()
Returns the schema of this table as read from the database.
|
ForeignKey |
getSelfReferencingForeignKey()
Returns the foreign key referencing this table if it exists.
|
String |
getType()
Returns the type of this table as read from the database.
|
Index[] |
getUniqueIndices()
Gets a list of unique indices on this table.
|
int |
hashCode() |
boolean |
hasPrimaryKey()
Determines whether there is at least one primary key column on this table.
|
void |
removeAllColumns()
Removes all columns of this table.
|
void |
removeAllForeignKeys()
Removes all foreign keys.
|
void |
removeColumn(Column column)
Removes the given column.
|
void |
removeColumn(int idx)
Removes the indicated column.
|
void |
removeForeignKey(ForeignKey foreignKey)
Removes the given foreign key.
|
void |
removeForeignKey(int idx)
Removes the indicated foreign key.
|
void |
removeIndex(Index index)
Removes the given index.
|
void |
removeIndex(int idx)
Removes the indicated index.
|
void |
setCatalog(String catalog)
Sets the catalog of this table.
|
void |
setDescription(String description)
Sets the description of the table.
|
void |
setName(String name)
Sets the name of the table.
|
void |
setSchema(String schema)
Sets the schema of this table.
|
void |
setType(String type)
Sets the type of this table.
|
void |
sortForeignKeys(boolean caseSensitive)
Sorts the foreign keys alphabetically.
|
String |
toString() |
String |
toVerboseString()
Returns a verbose string representation of this table.
|
public String getCatalog()
public void setCatalog(String catalog)
catalog - The catalogpublic String getSchema()
public void setSchema(String schema)
schema - The schemapublic String getType()
public void setType(String type)
type - The typepublic String getName()
public void setName(String name)
name - The namepublic String getQualifiedName()
public void getDelimitedName(StringBuilder query, String delimiterToken)
public String getDescription()
public void setDescription(String description)
description - The descriptionpublic int getColumnCount()
public Column getColumn(int idx)
idx - The column indexpublic Column[] getColumns()
public void addColumn(Column column)
column - The columnpublic void addColumn(int idx,
Column column)
idx - The index where to add the columncolumn - The columnpublic void addColumn(Column previousColumn, Column column)
previousColumn - The column to add the new column after; use
null for adding at the begincolumn - The columnpublic void addColumns(Collection columns)
columns - The columnspublic void removeColumn(Column column)
column - The column to removepublic void removeAllColumns()
public void removeColumn(int idx)
idx - The index of the column to removepublic int getForeignKeyCount()
public ForeignKey getForeignKey(int idx)
idx - The foreign key indexpublic ForeignKey[] getForeignKeys()
public void addForeignKey(ForeignKey foreignKey)
foreignKey - The foreign keypublic void addForeignKey(int idx,
ForeignKey foreignKey)
idx - The index to add the foreign key atforeignKey - The foreign keypublic void addForeignKeys(Collection foreignKeys)
foreignKeys - The foreign keyspublic void removeAllForeignKeys()
public void removeForeignKey(ForeignKey foreignKey)
foreignKey - The foreign key to removepublic void removeForeignKey(int idx)
idx - The index of the foreign key to removepublic int getIndexCount()
public Index getIndex(int idx)
idx - The positionpublic void addIndex(Index index)
index - The indexpublic void addIndex(int idx,
Index index)
idx - The position to add the index atindex - The indexpublic void addIndices(Collection indices)
indices - The indicespublic Index[] getIndices()
public Index[] getNonUniqueIndices()
public Index[] getUniqueIndices()
public void removeIndex(Index index)
index - The index to removepublic void removeIndex(int idx)
idx - The position of the index to removepublic boolean hasPrimaryKey()
true if there are one or more primary key columnspublic Column findColumn(String name)
name - The name of the columnnull if there is no such columnpublic Column findColumn(String name, boolean caseSensitive)
name - The name of the columncaseSensitive - Whether case matters for the namesnull if there is no such columnpublic int getColumnIndex(Column column)
column - The column-1 if it is no column of this tablepublic Index findIndex(String name)
name - The name of the indexnull if there is no such indexpublic Index findIndex(String name, boolean caseSensitive)
caseSensitive parameter.
Note that this method is not called getIndex to avoid introspection
problems.name - The name of the indexcaseSensitive - Whether case matters for the namesnull if there is no such indexpublic ForeignKey findForeignKey(String name)
name - The name of the foreign keynull if there is no such foreigb keypublic ForeignKey findForeignKey(String name, boolean caseSensitive)
caseSensitive parameter.
Note that this method is not called getForeignKey to avoid introspection
problems.name - The name of the foreign keycaseSensitive - Whether case matters for the namesnull if there is no such foreign keypublic ForeignKey findForeignKey(ForeignKey key)
key - The foreign key to search forpublic ForeignKey findForeignKey(ForeignKey key, boolean caseSensitive)
key - The foreign key to search forcaseSensitive - Whether case matters for the namespublic ForeignKey getSelfReferencingForeignKey()
public Column[] getPrimaryKeyColumns()
public String[] getPrimaryKeyColumnNames()
public Column[] getAutoIncrementColumns()
public Column[] getRequiredColumns()
public void sortForeignKeys(boolean caseSensitive)
caseSensitive - Whether case matterspublic String toVerboseString()
Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.