org.castor.ddlgen.schemaobject

Class Table

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

public abstract class Table
extends AbstractSchemaObject

Abstract base class of all table implementations.
Version:
$Revision: 5951 $ $Date: 2006-04-25 16:09:10 -0600 (Tue, 25 Apr 2006) $
Authors:
Le Duc Bao
Ralf Joachim
Since:
1.1

Field Summary

Fields inherited from class org.castor.ddlgen.schemaobject.AbstractSchemaObject

HASHFACTOR

Method Summary

void
addField(Field field)
Add given field to list of fields.
void
addForeignKey(ForeignKey foreignKey)
Add given foreign key to list of foreign keys.
void
addIndex(Index index)
Add given index to list of indices.
boolean
equals(Object other)
protected void
fields(DDLWriter writer)
Concatenate all fields names delimited by line separator.
Field
getField(String name)
Get field with given name.
Field
getField(int index)
Get field at given index.
int
getFieldCount()
Get number of fields.
ForeignKey
getForeignKey(int index)
Get foreign key at given index.
int
getForeignKeyCount()
Get number of foreign keys.
Index
getIndex(int index)
Get index at given index.
int
getIndexCount()
Get number of indices.
KeyGenerator
getKeyGenerator()
Get key generator used for identities of this table.
PrimaryKey
getPrimaryKey()
Get primary key with identities of this table.
Schema
getSchema()
Get schema this table belongs to.
int
hashCode()
void
merge(Table table)
Check if given table can be merged with this one.
void
setKeyGenerator(KeyGenerator keyGenerator)
Set key generator used for identities of this table.
void
setPrimaryKey(PrimaryKey primaryKey)
Set primary key with identities of this table.
void
setSchema(Schema schema)
Set schema this table belongs to.

Methods inherited from class org.castor.ddlgen.schemaobject.AbstractSchemaObject

equals, getConfiguration, getName, setConfiguration, setName

Method Details

addField

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

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.

addIndex

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

equals

public final boolean equals(Object other)

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.

getField

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

getField

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

getFieldCount

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

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.

getForeignKeyCount

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

getIndex

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

getIndexCount

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

getKeyGenerator

public final KeyGenerator getKeyGenerator()
Get key generator used for identities of this table.
Returns:
Key generator used for 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.

getSchema

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

hashCode

public final int hashCode()

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.

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.

setPrimaryKey

public final void setPrimaryKey(PrimaryKey primaryKey)
Set primary key with identities of this table.
Parameters:
primaryKey - 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.

Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com