org.eobjects.metamodel.schema
Class AbstractTable

java.lang.Object
  extended by org.eobjects.metamodel.schema.AbstractTable
All Implemented Interfaces:
Serializable, Comparable<Table>, NamedStructure, Table, HasName
Direct Known Subclasses:
MutableTable

public abstract class AbstractTable
extends Object
implements Table

Abstract Table implementation. Includes most common/trivial methods.

Author:
Kasper Sørensen
See Also:
Serialized Form

Constructor Summary
AbstractTable()
           
 
Method Summary
 int compareTo(Table that)
           
 boolean equals(Object obj)
           
 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[] 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.
 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.
 String getQualifiedLabel()
          Gets a qualified label for later lookup.
 String getQuotedName()
          Gets the name, including optional quotes, of this structure.
 int getRelationshipCount()
          Gets a count of relationships to and from this table.
 Relationship[] getRelationships(Table otherTable)
          Gets relationships between this table and another table.
 Column[] getTimeBasedColumns()
          Gets all of this table's columns that are time and/or date based.
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eobjects.metamodel.schema.Table
getColumns, getName, getRelationships, getRemarks, getSchema, getType
 
Methods inherited from interface org.eobjects.metamodel.schema.NamedStructure
getQuote
 

Constructor Detail

AbstractTable

public AbstractTable()
Method Detail

getColumnCount

public final int getColumnCount()
Description copied from interface: Table
Gets the number of columns in this table.

Specified by:
getColumnCount in interface Table
Returns:
the number of columns in this table.

getColumn

public Column getColumn(int index)
                 throws IndexOutOfBoundsException
Description copied from interface: Table
Gets a column by index. Use Table.getColumnCount() to get the (0-based) index range.

Specified by:
getColumn in interface Table
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)

getColumnByName

public final Column getColumnByName(String columnName)
Description copied from interface: Table
Convenience method for retrieving a column by it's name.

Specified by:
getColumnByName in interface Table
Parameters:
columnName - the name of the column to retrieve
Returns:
the column with the given name. Returns null if no such column is found.

getRelationshipCount

public final int getRelationshipCount()
Description copied from interface: Table
Gets a count of relationships to and from this table.

Specified by:
getRelationshipCount in interface Table
Returns:
a count of relationships to and from this table.

getNumberColumns

public final Column[] getNumberColumns()
Description copied from interface: Table
Gets all of this table's columns that are of number type.

Specified by:
getNumberColumns in interface Table
Returns:
an array of columns.
See Also:
ColumnType

getLiteralColumns

public final Column[] getLiteralColumns()
Description copied from interface: Table
Gets all of this table's columns that are of literal (String/text) type.

Specified by:
getLiteralColumns in interface Table
Returns:
an array of columns.
See Also:
ColumnType

getTimeBasedColumns

public final Column[] getTimeBasedColumns()
Description copied from interface: Table
Gets all of this table's columns that are time and/or date based.

Specified by:
getTimeBasedColumns in interface Table
Returns:
an array of columns.
See Also:
ColumnType

getBooleanColumns

public final Column[] getBooleanColumns()
Description copied from interface: Table
Gets all of this table's columns that are of boolean type.

Specified by:
getBooleanColumns in interface Table
Returns:
an array of columns.
See Also:
ColumnType

getIndexedColumns

public final Column[] getIndexedColumns()
Description copied from interface: Table
Gets all of this table's columns that are indexed.

Specified by:
getIndexedColumns in interface Table
Returns:
an array of columns.

getForeignKeyRelationships

public final Relationship[] getForeignKeyRelationships()
Specified by:
getForeignKeyRelationships in interface Table
Returns:
the relationships where this table is the foreign table

getPrimaryKeyRelationships

public final Relationship[] getPrimaryKeyRelationships()
Specified by:
getPrimaryKeyRelationships in interface Table
Returns:
the relationships where this table is the primary table

getForeignKeys

public final Column[] getForeignKeys()
Description copied from interface: Table
Gets the columns of this table that are known to be foreign keys (ie. references primary keys in other tables).

Specified by:
getForeignKeys in interface Table
Returns:
an array of columns that are known to be foreign keys.

getPrimaryKeys

public final Column[] getPrimaryKeys()
Description copied from interface: Table
Gets the columns of this table that are known to be primary keys. See Column.isPrimaryKey().

Specified by:
getPrimaryKeys in interface Table
Returns:
an array of columns that are known to be primary keys.

getColumnNames

public final String[] getColumnNames()
Description copied from interface: Table
Gets the names of this table's columns.

Specified by:
getColumnNames in interface Table
Returns:
an array of column names.

getColumnsOfType

public final Column[] getColumnsOfType(ColumnType columnType)
Description copied from interface: Table
Gets the columns of this table that conforms to a specified ColumnType.

Specified by:
getColumnsOfType in interface Table
Parameters:
columnType - the column type to search for.
Returns:
an array of columns that match the specified ColumnType.

getColumnsOfSuperType

public final Column[] getColumnsOfSuperType(SuperColumnType superColumnType)
Description copied from interface: Table
Gets the columns of this table that conforms to a specified SuperColumnType.

Specified by:
getColumnsOfSuperType in interface Table
Parameters:
superColumnType - the super type of the column
Returns:
an array of columns that match the specified SuperColumnType.

getRelationships

public final Relationship[] getRelationships(Table otherTable)
Description copied from interface: Table
Gets relationships between this table and another table.

Specified by:
getRelationships in interface Table
Parameters:
otherTable - another table for which to find relationships to and from.
Returns:
an array of relationsips between this and the other table.

getQuotedName

public final String getQuotedName()
Description copied from interface: NamedStructure
Gets the name, including optional quotes, of this structure.

Specified by:
getQuotedName in interface NamedStructure
Returns:
The name of the structure with added quote strings.

getQualifiedLabel

public final String getQualifiedLabel()
Description copied from interface: NamedStructure
Gets a qualified label for later lookup. Typically this qualified label is formatted with a simple dot separator. For example, for a column a typical qualified label would be: "MY_SCHEMA.MY_TABLE.MY_COLUMN". The qualified label can be used as a unique identifier for the structure but is not necessarily directly transferable to SQL syntax.

Specified by:
getQualifiedLabel in interface NamedStructure
Returns:
a qualified label

toString

public final String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

compareTo

public final int compareTo(Table that)
Specified by:
compareTo in interface Comparable<Table>


Copyright © 2007-2013. All Rights Reserved.