net.sourceforge.schemaspy.model
Class Table
java.lang.Object
net.sourceforge.schemaspy.model.Table
- All Implemented Interfaces:
- Comparable
- Direct Known Subclasses:
- View
public class Table
- extends Object
- implements Comparable
Table
public Table(Database db,
String schema,
String name,
String comments,
DatabaseMetaData meta,
Properties properties)
throws SQLException
- Throws:
SQLException
connectForeignKeys
public void connectForeignKeys(Map tables,
DatabaseMetaData meta)
throws SQLException
- Throws:
SQLException
getForeignKey
public ForeignKeyConstraint getForeignKey(String keyName)
getForeignKeys
public Collection getForeignKeys()
addCheckConstraint
public void addCheckConstraint(String name,
String text)
getIndex
public TableIndex getIndex(String indexName)
getSchema
public String getSchema()
getName
public String getName()
setId
public void setId(Object id)
getId
public Object getId()
getCheckConstraints
public Map getCheckConstraints()
getIndexes
public Set getIndexes()
getPrimaryColumns
public List getPrimaryColumns()
getComments
public String getComments()
- Returns:
- Comments associated with this table, or
null if none.
setComments
public void setComments(String comments)
getColumn
public TableColumn getColumn(String columnName)
getColumns
public List getColumns()
- Returns
List of TableColumns in ascending column number order.
- Returns:
getMaxParents
public int getMaxParents()
addedParent
public void addedParent()
unlinkParents
public void unlinkParents()
isRoot
public boolean isRoot()
getMaxChildren
public int getMaxChildren()
addedChild
public void addedChild()
unlinkChildren
public void unlinkChildren()
isLeaf
public boolean isLeaf()
removeSelfReferencingConstraint
public ForeignKeyConstraint removeSelfReferencingConstraint()
getNumChildren
public int getNumChildren()
getNumRealChildren
public int getNumRealChildren()
getNumParents
public int getNumParents()
getNumRealParents
public int getNumRealParents()
removeAForeignKeyConstraint
public ForeignKeyConstraint removeAForeignKeyConstraint()
isView
public boolean isView()
getViewSql
public String getViewSql()
getNumRows
public int getNumRows()
fetchNumRows
protected int fetchNumRows(Database db)
- fetch the number of rows contained in this table.
returns -1 if unable to successfully fetch the row count
- Parameters:
db - Database
- Returns:
- int
- Throws:
SQLException
fetchNumRows
protected int fetchNumRows(Database db,
String clause)
throws SQLException
- Throws:
SQLException
toString
public String toString()
- Overrides:
toString in class Object
isOrphan
public boolean isOrphan(boolean withImpliedRelationships)
- isOrphan
- Parameters:
withImpliedRelationships - boolean
- Returns:
- boolean
compareTo
public int compareTo(Object o)
- Specified by:
compareTo in interface Comparable
Copyright © 2007-2010. All Rights Reserved.