org.codehaus.modello.generator.database.model

Class Table

public class Table extends Object

Models a table.

Version: $Id: Table.java 149 2004-09-29 17:32:16Z jvanzyl $

Author: John Marshall/Connectria Matthew Hawthorne

Constructor Summary
Table()
Method Summary
voidaddAll(List columns)
voidaddColumn(Column column)
voidaddForeignKey(ForeignKey foreignKey)
voidaddIndex(Index index)
voidaddUnique(Unique index)
Add a unique index to this table
ColumnfindColumn(String name)
Finds the table with the specified name, using case insensitive matching.
IndexfindIndex(String name)
Finds the index with the specified name, using case insensitive matching.
ColumngetAutoIncrementColumn()
StringgetCatalog()
ColumngetColumn(int index)
ListgetColumns()
ForeignKeygetForeignKey(int index)
ListgetForeignKeys()
IndexgetIndex(int index)
ListgetIndexes()
StringgetName()
ListgetPrimaryKeyColumns()
StringgetRemarks()
StringgetSchema()
StringgetType()
booleanhasPrimaryKey()
voidsetCatalog(String catalog)
voidsetName(String name)
voidsetRemarks(String remarks)
voidsetSchema(String schema)
voidsetType(String type)

Constructor Detail

Table

public Table()

Method Detail

addAll

public void addAll(List columns)

addColumn

public void addColumn(Column column)

addForeignKey

public void addForeignKey(ForeignKey foreignKey)

addIndex

public void addIndex(Index index)

addUnique

public void addUnique(Unique index)
Add a unique index to this table

Parameters: index The unique index

findColumn

public Column findColumn(String name)
Finds the table with the specified name, using case insensitive matching. Note that this method is not called getColumn(String) to avoid introspection problems.

findIndex

public Index findIndex(String name)
Finds the index with the specified name, using case insensitive matching. Note that this method is not called getIndex(String) to avoid introspection problems.

getAutoIncrementColumn

public Column getAutoIncrementColumn()

Returns: the auto increment column, if there is one, otherwise null is returned

getCatalog

public String getCatalog()

getColumn

public Column getColumn(int index)

getColumns

public List getColumns()

getForeignKey

public ForeignKey getForeignKey(int index)

getForeignKeys

public List getForeignKeys()

getIndex

public Index getIndex(int index)

getIndexes

public List getIndexes()

getName

public String getName()

getPrimaryKeyColumns

public List getPrimaryKeyColumns()

Returns: a List of primary key columns or an empty list if there are no primary key columns for this Table

getRemarks

public String getRemarks()

getSchema

public String getSchema()

getType

public String getType()

hasPrimaryKey

public boolean hasPrimaryKey()

Returns: true if there is at least one primary key column on this table

setCatalog

public void setCatalog(String catalog)

setName

public void setName(String name)

setRemarks

public void setRemarks(String remarks)

setSchema

public void setSchema(String schema)

setType

public void setType(String type)
Copyright © 2001-2009 Codehaus. All Rights Reserved.