|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.ddlutils.model.Table
public class Table
Represents a table in the database model.
Constructor Summary | |
---|---|
Table()
|
Method Summary | |
---|---|
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(java.util.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(java.util.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(java.util.Collection indices)
Adds the given indices. |
java.lang.Object |
clone()
|
boolean |
equals(java.lang.Object obj)
|
Column |
findColumn(java.lang.String name)
Finds the column with the specified name, using case insensitive matching. |
Column |
findColumn(java.lang.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. |
Index |
findIndex(java.lang.String name)
Finds the index with the specified name, using case insensitive matching. |
Index |
findIndex(java.lang.String name,
boolean caseSensitive)
Finds the index with the specified name, using case insensitive matching. |
Column[] |
getAutoIncrementColumns()
Returns the auto increment columns in this table. |
java.lang.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. |
java.lang.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. |
java.lang.String |
getName()
Returns the name of the table. |
Index[] |
getNonUniqueIndices()
Gets a list of non-unique indices on this table. |
Column[] |
getPrimaryKeyColumns()
Returns the primary key columns of this table. |
java.lang.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. |
java.lang.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 |
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(java.lang.String catalog)
Sets the catalog of this table. |
void |
setDescription(java.lang.String description)
Sets the description of the table. |
void |
setName(java.lang.String name)
Sets the name of the table. |
void |
setSchema(java.lang.String schema)
Sets the schema of this table. |
void |
setType(java.lang.String type)
Sets the type of this table. |
void |
sortForeignKeys(boolean caseSensitive)
Sorts the foreign keys alphabetically. |
java.lang.String |
toString()
|
java.lang.String |
toVerboseString()
Returns a verbose string representation of this table. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Table()
Method Detail |
---|
public java.lang.String getCatalog()
public void setCatalog(java.lang.String catalog)
catalog
- The catalogpublic java.lang.String getSchema()
public void setSchema(java.lang.String schema)
schema
- The schemapublic java.lang.String getType()
public void setType(java.lang.String type)
type
- The typepublic java.lang.String getName()
public void setName(java.lang.String name)
name
- The namepublic java.lang.String getDescription()
public void setDescription(java.lang.String description)
description
- The descriptionpublic int getColumnCount()
public Column getColumn(int idx)
idx
- The column index
public 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(java.util.Collection columns)
columns
- The columnspublic void removeColumn(Column column)
column
- The column to removepublic void removeColumn(int idx)
idx
- The index of the column to removepublic int getForeignKeyCount()
public ForeignKey getForeignKey(int idx)
idx
- The foreign key index
public 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(java.util.Collection foreignKeys)
foreignKeys
- The foreign keyspublic 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 position
public 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(java.util.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(java.lang.String name)
name
- The name of the column
null
if there is no such columnpublic Column findColumn(java.lang.String name, boolean caseSensitive)
name
- The name of the columncaseSensitive
- Whether case matters for the names
null
if there is no such columnpublic int getColumnIndex(Column column)
column
- The column
-1
if it is no column of this tablepublic Index findIndex(java.lang.String name)
name
- The name of the index
null
if there is no such indexpublic Index findIndex(java.lang.String name, boolean caseSensitive)
name
- The name of the indexcaseSensitive
- Whether case matters for the names
null
if there is no such indexpublic ForeignKey findForeignKey(ForeignKey key)
key
- The foreign key to search for
public ForeignKey findForeignKey(ForeignKey key, boolean caseSensitive)
key
- The foreign key to search forcaseSensitive
- Whether case matters for the names
public ForeignKey getSelfReferencingForeignKey()
public Column[] getPrimaryKeyColumns()
public Column[] getAutoIncrementColumns()
public void sortForeignKeys(boolean caseSensitive)
caseSensitive
- Whether case matterspublic java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toVerboseString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |