org.eobjects.metamodel.schema
Interface Table

All Superinterfaces:
Comparable<Table>, HasName, NamedStructure, Serializable
All Known Implementing Classes:
AbstractTable, MutableTable

public interface Table
extends Comparable<Table>, Serializable, NamedStructure

Represents a table and it's metadata description. Tables reside within a schema and contains columns and relationships to other tables.

Author:
Kasper Sørensen
See Also:
Schema, Column

Method Summary
 Column[] getBooleanColumns()
          Gets all of this table's columns that are of boolean type.
 Column getColumn(int index)
          Gets a column by index.
 Column getColumnByName(String columnName)
          Convenience method for retrieving a column by it's name.
 int getColumnCount()
          Gets the number of columns in this table.
 String[] getColumnNames()
          Gets the names of this table's columns.
 Column[] getColumns()
          Gets the columns of this table.
 Column[] getColumnsOfSuperType(SuperColumnType superColumnType)
          Gets the columns of this table that conforms to a specified SuperColumnType.
 Column[] getColumnsOfType(ColumnType columnType)
          Gets the columns of this table that conforms to a specified ColumnType.
 Relationship[] getForeignKeyRelationships()
           
 Column[] getForeignKeys()
          Gets the columns of this table that are known to be foreign keys (ie.
 Column[] getIndexedColumns()
          Gets all of this table's columns that are indexed.
 Column[] getLiteralColumns()
          Gets all of this table's columns that are of literal (String/text) type.
 String getName()
          Gets the name of this Table
 Column[] getNumberColumns()
          Gets all of this table's columns that are of number type.
 Relationship[] getPrimaryKeyRelationships()
           
 Column[] getPrimaryKeys()
          Gets the columns of this table that are known to be primary keys.
 int getRelationshipCount()
          Gets a count of relationships to and from this table.
 Relationship[] getRelationships()
          Gets all relationships for this table.
 Relationship[] getRelationships(Table otherTable)
          Gets relationships between this table and another table.
 String getRemarks()
          Gets remarks/comments to this table.
 Schema getSchema()
          Gets the schema that this table resides in.
 Column[] getTimeBasedColumns()
          Gets all of this table's columns that are time and/or date based.
 TableType getType()
          Gets the table type of this table.
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface org.eobjects.metamodel.schema.NamedStructure
getQualifiedLabel, getQuote, getQuotedName
 

Method Detail

getName

String getName()
Gets the name of this Table

Specified by:
getName in interface HasName
Specified by:
getName in interface NamedStructure
Returns:
the name of this Table

getColumnCount

int getColumnCount()
Gets the number of columns in this table.

Returns:
the number of columns in this table.

getColumns

Column[] getColumns()
Gets the columns of this table.

Returns:
the columns of this table.

getColumnByName

Column getColumnByName(String columnName)
Convenience method for retrieving a column by it's name.

Parameters:
columnName - the name of the column to retrieve
Returns:
the column with the given name. Returns null if no such column is found.

getColumn

Column getColumn(int index)
                 throws IndexOutOfBoundsException
Gets a column by index. Use getColumnCount() to get the (0-based) index range.

Parameters:
index - the index of the column
Returns:
the column with the specified index
Throws:
IndexOutOfBoundsException - if the index is out of bounds (index >= column count)

getSchema

Schema getSchema()
Gets the schema that this table resides in.

Returns:
the schema that the table resides in.

getType

TableType getType()
Gets the table type of this table.

Returns:
the type of table

getRelationships

Relationship[] getRelationships()
Gets all relationships for this table.

Returns:
all relationsips for this table. To add relations use TableRelation.createRelation();

getRelationships

Relationship[] getRelationships(Table otherTable)
Gets relationships between this table and another table.

Parameters:
otherTable - another table for which to find relationships to and from.
Returns:
an array of relationsips between this and the other table.

getRelationshipCount

int getRelationshipCount()
Gets a count of relationships to and from this table.

Returns:
a count of relationships to and from this table.

getRemarks

String getRemarks()
Gets remarks/comments to this table.

Returns:
remarks/comments to this table or null if none exist.

getNumberColumns

Column[] getNumberColumns()
Gets all of this table's columns that are of number type.

Returns:
an array of columns.
See Also:
ColumnType

getLiteralColumns

Column[] getLiteralColumns()
Gets all of this table's columns that are of literal (String/text) type.

Returns:
an array of columns.
See Also:
ColumnType

getTimeBasedColumns

Column[] getTimeBasedColumns()
Gets all of this table's columns that are time and/or date based.

Returns:
an array of columns.
See Also:
ColumnType

getBooleanColumns

Column[] getBooleanColumns()
Gets all of this table's columns that are of boolean type.

Returns:
an array of columns.
See Also:
ColumnType

getIndexedColumns

Column[] getIndexedColumns()
Gets all of this table's columns that are indexed.

Returns:
an array of columns.

getForeignKeyRelationships

Relationship[] getForeignKeyRelationships()
Returns:
the relationships where this table is the foreign table

getPrimaryKeyRelationships

Relationship[] getPrimaryKeyRelationships()
Returns:
the relationships where this table is the primary table

getForeignKeys

Column[] getForeignKeys()
Gets the columns of this table that are known to be foreign keys (ie. references primary keys in other tables).

Returns:
an array of columns that are known to be foreign keys.

getPrimaryKeys

Column[] getPrimaryKeys()
Gets the columns of this table that are known to be primary keys. See Column.isPrimaryKey().

Returns:
an array of columns that are known to be primary keys.

getColumnNames

String[] getColumnNames()
Gets the names of this table's columns.

Returns:
an array of column names.

getColumnsOfType

Column[] getColumnsOfType(ColumnType columnType)
Gets the columns of this table that conforms to a specified ColumnType.

Parameters:
columnType - the column type to search for.
Returns:
an array of columns that match the specified ColumnType.

getColumnsOfSuperType

Column[] getColumnsOfSuperType(SuperColumnType superColumnType)
Gets the columns of this table that conforms to a specified SuperColumnType.

Parameters:
superColumnType - the super type of the column
Returns:
an array of columns that match the specified SuperColumnType.


Copyright © 2007-2013. All Rights Reserved.