org.codehaus.modello.generator.database.model
Class Table

java.lang.Object
  extended by org.codehaus.modello.generator.database.model.Table

public class Table
extends java.lang.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
 void addAll(java.util.List columns)
           
 void addColumn(Column column)
           
 void addForeignKey(ForeignKey foreignKey)
           
 void addIndex(Index index)
           
 void addUnique(Unique index)
          Add a unique index to this table
 Column findColumn(java.lang.String name)
          Finds the table with the specified name, using case insensitive matching.
 Index findIndex(java.lang.String name)
          Finds the index with the specified name, using case insensitive matching.
 Column getAutoIncrementColumn()
           
 java.lang.String getCatalog()
           
 Column getColumn(int index)
           
 java.util.List getColumns()
           
 ForeignKey getForeignKey(int index)
           
 java.util.List getForeignKeys()
           
 Index getIndex(int index)
           
 java.util.List getIndexes()
           
 java.lang.String getName()
           
 java.util.List getPrimaryKeyColumns()
           
 java.lang.String getRemarks()
           
 java.lang.String getSchema()
           
 java.lang.String getType()
           
 boolean hasPrimaryKey()
           
 void setCatalog(java.lang.String catalog)
           
 void setName(java.lang.String name)
           
 void setRemarks(java.lang.String remarks)
           
 void setSchema(java.lang.String schema)
           
 void setType(java.lang.String type)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Table

public Table()
Method Detail

getCatalog

public java.lang.String getCatalog()

setCatalog

public void setCatalog(java.lang.String catalog)

getRemarks

public java.lang.String getRemarks()

setRemarks

public void setRemarks(java.lang.String remarks)

getSchema

public java.lang.String getSchema()

setSchema

public void setSchema(java.lang.String schema)

getType

public java.lang.String getType()

setType

public void setType(java.lang.String type)

getName

public java.lang.String getName()

setName

public void setName(java.lang.String name)

addColumn

public void addColumn(Column column)

addAll

public void addAll(java.util.List columns)

getColumns

public java.util.List getColumns()

addForeignKey

public void addForeignKey(ForeignKey foreignKey)

getForeignKeys

public java.util.List getForeignKeys()

getColumn

public Column getColumn(int index)

getForeignKey

public ForeignKey getForeignKey(int index)

addIndex

public void addIndex(Index index)

getIndexes

public java.util.List getIndexes()

getIndex

public Index getIndex(int index)

addUnique

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

Parameters:
index - The unique index

hasPrimaryKey

public boolean hasPrimaryKey()
Returns:
true if there is at least one primary key column on this table

findColumn

public Column findColumn(java.lang.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(java.lang.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.


getPrimaryKeyColumns

public java.util.List getPrimaryKeyColumns()
Returns:
a List of primary key columns or an empty list if there are no primary key columns for this Table

getAutoIncrementColumn

public Column getAutoIncrementColumn()
Returns:
the auto increment column, if there is one, otherwise null is returned


Copyright © 2001-2007 Codehaus. All Rights Reserved.