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 voidAdd given field to list of fields.final voidaddForeignKey(ForeignKey foreignKey) Add given foreign key to list of foreign keys.final voidAdd given index to list of indices.final booleanprotected final voidConcatenate all fields names delimited by line separator.final FieldgetField(int index) Get field at given index.final FieldGet field with given name.final intGet number of fields.final ForeignKeygetForeignKey(int index) Get foreign key at given index.final intGet number of foreign keys.final IndexgetIndex(int index) Get index at given index.final intGet number of indices.final KeyGeneratorGet key generator used for identities of this table.final PrimaryKeyGet primary key with identities of this table.final SchemaGet schema this table belongs to.final inthashCode()final voidCheck if given table can be merged with this one.final voidsetKeyGenerator(KeyGenerator keyGenerator) Set key generator used for identities of this table.final voidsetPrimaryKey(PrimaryKey primaryKey) Set primary key with identities of this table.final voidSet schema this table belongs to.Methods inherited from class org.castor.ddlgen.schemaobject.AbstractSchemaObject
equals, getConfiguration, getName, setConfiguration, setNameMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods 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()
-