com.perdues.db
Class TableInfo

java.lang.Object
  |
  +--com.perdues.db.TableInfo

public class TableInfo
extends java.lang.Object

Class holding information about a table of a database.


Field Summary
static boolean debug
           
 
Method Summary
 ColumnInfo getColumn(java.lang.String name)
          Returns the ColumnInfo having the given, unqualified name.
 DBInfo getDatabase()
          The Database of this table.
 java.lang.String getEnoughName()
          Adequately-qualified name of table based.
 TableInfo getExtends()
          Returns the TableInfo of the table that this extends, or null if none.
 ColumnInfo getForeignKey(TableInfo table)
          Returns the column that is the foreign key into the given Table, or null if none.
 java.lang.String getFullName()
          Fully-qualified name of the table.
 java.lang.String getName()
          Unqualified name of the table.
 ColumnInfo getPrimaryColumn()
          Returns the column that is the primary key.
 java.lang.String getPrimaryKey()
          Returns the name of the primary key field, or null if there is none.
 java.lang.String getShorthand()
          Shorthand name of the table.
 boolean hasShorthand()
          Returns true iff this table has a shorthand.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

public static boolean debug
Method Detail

getName

public java.lang.String getName()
Unqualified name of the table.

getFullName

public java.lang.String getFullName()
Fully-qualified name of the table.

getEnoughName

public java.lang.String getEnoughName()
Adequately-qualified name of table based. Same as fully qualified name unless there is more than one database and this table's database is not the one designated as in-use.

hasShorthand

public boolean hasShorthand()
Returns true iff this table has a shorthand. In this case getShorthand will return a different result than getName.

getShorthand

public java.lang.String getShorthand()
Shorthand name of the table. If no shorthand name is supplied, this will give the same value as getName().

getDatabase

public DBInfo getDatabase()
The Database of this table.

getColumn

public ColumnInfo getColumn(java.lang.String name)
Returns the ColumnInfo having the given, unqualified name.

getPrimaryKey

public java.lang.String getPrimaryKey()
Returns the name of the primary key field, or null if there is none.

getPrimaryColumn

public ColumnInfo getPrimaryColumn()
Returns the column that is the primary key.

getExtends

public TableInfo getExtends()
Returns the TableInfo of the table that this extends, or null if none. Bad name throws an exception.

getForeignKey

public ColumnInfo getForeignKey(TableInfo table)
Returns the column that is the foreign key into the given Table, or null if none.