Package org.castor.ddlgen.schemaobject
Class Table
java.lang.Object
org.castor.ddlgen.schemaobject.AbstractSchemaObject
org.castor.ddlgen.schemaobject.Table
- All Implemented Interfaces:
SchemaObject
- Direct Known Subclasses:
DefaultTable
,HsqlTable
,MysqlTable
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
-
Field Summary
Fields inherited from class org.castor.ddlgen.schemaobject.AbstractSchemaObject
HASHFACTOR
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal void
Add given field to list of fields.final void
addForeignKey
(ForeignKey foreignKey) Add given foreign key to list of foreign keys.final void
Add given index to list of indices.final boolean
protected final void
Concatenate all fields names delimited by line separator.final Field
getField
(int index) Get field at given index.final Field
Get field with given name.final int
Get number of fields.final ForeignKey
getForeignKey
(int index) Get foreign key at given index.final int
Get number of foreign keys.final Index
getIndex
(int index) Get index at given index.final int
Get number of indices.final KeyGenerator
Get key generator used for identities of this table.final PrimaryKey
Get primary key with identities of this table.final Schema
Get schema this table belongs to.final int
hashCode()
final void
Check if given table can be merged with this one.final void
setKeyGenerator
(KeyGenerator keyGenerator) Set key generator used for identities of this table.final void
setPrimaryKey
(PrimaryKey primaryKey) Set primary key with identities of this table.final void
Set schema this table belongs to.Methods inherited from class org.castor.ddlgen.schemaobject.AbstractSchemaObject
equals, getConfiguration, getName, setConfiguration, setName
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.castor.ddlgen.schemaobject.SchemaObject
toCreateDDL, toDropDDL
-
Constructor Details
-
Table
public Table()
-
-
Method Details
-
addIndex
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
Get index at given index.- Parameters:
index
- Index of index to return.- Returns:
- Index at given index.
-
addForeignKey
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
Get foreign key at given index.- Parameters:
index
- Index of foreign key to return.- Returns:
- Foreign key at given index.
-
addField
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
Get field at given index.- Parameters:
index
- Index of field to return.- Returns:
- Field at given index.
-
getField
Get field with given name.- Parameters:
name
- Name of field to return.- Returns:
- Field with given name.
-
setKeyGenerator
Set key generator used for identities of this table.- Parameters:
keyGenerator
- Key generator used for identities of this table.
-
getKeyGenerator
Get key generator used for identities of this table.- Returns:
- Key generator used for identities of this table.
-
setPrimaryKey
Set primary key with identities of this table.- Parameters:
primaryKey
- Primary key with identities of this table.
-
getPrimaryKey
Get primary key with identities of this table.- Returns:
- Primary key with identities of this table.
-
setSchema
Set schema this table belongs to.- Parameters:
schema
- Schema this table belongs to.
-
getSchema
Get schema this table belongs to.- Returns:
- Schema this table belongs to.
-
fields
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
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
-
hashCode
public final int hashCode()
-