net.sourceforge.schemaspy.model
Class Table

java.lang.Object
  extended by net.sourceforge.schemaspy.model.Table
All Implemented Interfaces:
Comparable
Direct Known Subclasses:
View

public class Table
extends Object
implements Comparable


Constructor Summary
Table(Database db, String schema, String name, String comments, DatabaseMetaData meta, Properties properties)
           
 
Method Summary
 void addCheckConstraint(String name, String text)
           
 void addedChild()
           
 void addedParent()
           
 int compareTo(Object o)
           
 void connectForeignKeys(Map tables, DatabaseMetaData meta)
           
protected  int fetchNumRows(Database db)
          fetch the number of rows contained in this table.
protected  int fetchNumRows(Database db, String clause)
           
 Map getCheckConstraints()
           
 TableColumn getColumn(String columnName)
           
 List getColumns()
          Returns List of TableColumns in ascending column number order.
 String getComments()
           
 ForeignKeyConstraint getForeignKey(String keyName)
           
 Collection getForeignKeys()
           
 Object getId()
           
 TableIndex getIndex(String indexName)
           
 Set getIndexes()
           
 int getMaxChildren()
           
 int getMaxParents()
           
 String getName()
           
 int getNumChildren()
           
 int getNumParents()
           
 int getNumRealChildren()
           
 int getNumRealParents()
           
 int getNumRows()
           
 List getPrimaryColumns()
           
 String getSchema()
           
 String getViewSql()
           
 boolean isLeaf()
           
 boolean isOrphan(boolean withImpliedRelationships)
          isOrphan
 boolean isRoot()
           
 boolean isView()
           
 ForeignKeyConstraint removeAForeignKeyConstraint()
           
 ForeignKeyConstraint removeSelfReferencingConstraint()
           
 void setComments(String comments)
           
 void setId(Object id)
           
 String toString()
           
 void unlinkChildren()
           
 void unlinkParents()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Table

public Table(Database db,
             String schema,
             String name,
             String comments,
             DatabaseMetaData meta,
             Properties properties)
      throws SQLException
Throws:
SQLException
Method Detail

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.