Class Table

All Implemented Interfaces:
SchemaObject
Direct Known Subclasses:
DefaultTable, HsqlTable, MysqlTable

public abstract class Table extends AbstractSchemaObject
Abstract base class of all table implementations.
Since:
1.1
Version:
$Revision: 5951 $ $Date: 2006-04-25 16:09:10 -0600 (Tue, 25 Apr 2006) $
Author:
Le Duc Bao, Ralf Joachim
  • Constructor Details

    • Table

      public Table()
  • Method Details

    • addIndex

      public final void addIndex(Index index)
      Add given index to list of indices.
      Parameters:
      index - Index to add to list of indices.
    • getIndexCount

      public final int getIndexCount()
      Get number of indices.
      Returns:
      Number of indices.
    • getIndex

      public final Index getIndex(int index)
      Get index at given index.
      Parameters:
      index - Index of index to return.
      Returns:
      Index at given index.
    • addForeignKey

      public final void addForeignKey(ForeignKey foreignKey)
      Add given foreign key to list of foreign keys.
      Parameters:
      foreignKey - Foreign key to add to list of foreign keys.
    • getForeignKeyCount

      public final int getForeignKeyCount()
      Get number of foreign keys.
      Returns:
      Number of foreign keys.
    • getForeignKey

      public final ForeignKey getForeignKey(int index)
      Get foreign key at given index.
      Parameters:
      index - Index of foreign key to return.
      Returns:
      Foreign key at given index.
    • addField

      public final void addField(Field field)
      Add given field to list of fields.
      Parameters:
      field - Field to add to list of fields.
    • getFieldCount

      public final int getFieldCount()
      Get number of fields.
      Returns:
      Number of fields.
    • getField

      public final Field getField(int index)
      Get field at given index.
      Parameters:
      index - Index of field to return.
      Returns:
      Field at given index.
    • getField

      public final Field getField(String name)
      Get field with given name.
      Parameters:
      name - Name of field to return.
      Returns:
      Field with given name.
    • setKeyGenerator

      public final void setKeyGenerator(KeyGenerator keyGenerator)
      Set key generator used for identities of this table.
      Parameters:
      keyGenerator - Key generator used for identities of this table.
    • getKeyGenerator

      public final KeyGenerator getKeyGenerator()
      Get key generator used for identities of this table.
      Returns:
      Key generator used for identities of this table.
    • setPrimaryKey

      public final void setPrimaryKey(PrimaryKey primaryKey)
      Set primary key with identities of this table.
      Parameters:
      primaryKey - Primary key with identities of this table.
    • getPrimaryKey

      public final PrimaryKey getPrimaryKey()
      Get primary key with identities of this table.
      Returns:
      Primary key with identities of this table.
    • setSchema

      public final void setSchema(Schema schema)
      Set schema this table belongs to.
      Parameters:
      schema - Schema this table belongs to.
    • getSchema

      public final Schema getSchema()
      Get schema this table belongs to.
      Returns:
      Schema this table belongs to.
    • fields

      protected final void fields(DDLWriter writer) throws GeneratorException
      Concatenate all fields names delimited by line separator.
      Parameters:
      writer - DDLWriter to write schema objects to.
      Throws:
      GeneratorException - If generation of the script failed or is not supported.
    • merge

      public final void merge(Table table) throws GeneratorException
      Check if given table can be merged with this one.
      Parameters:
      table - Table to check if it is able to be merged.
      Throws:
      GeneratorException - If tables cannot be merged.
    • equals

      public final boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object