org.eclipse.jpt.db
Interface Table

All Superinterfaces:
java.lang.Comparable<Table>, DatabaseObject

public interface Table
extends DatabaseObject, java.lang.Comparable<Table>

Database table Provisional API: This interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves. This interface is not intended to be implemented by clients.


Method Summary
 java.util.Iterator<Column> columns()
          Return the table's columns.
 int columnsSize()
          Return the number of columns the table contains.
 java.util.Iterator<ForeignKey> foreignKeys()
          Return the table's foreign keys.
 int foreignKeysSize()
          Return the number of foreign keys the table contains.
 Column getColumnForIdentifier(java.lang.String identifier)
          Return the column for the specified identifier.
 Column getColumnNamed(java.lang.String name)
          Return the column with specified name.
 ForeignKey getJoinTableNonOwningForeignKey()
          Assuming the table is a "join" table, return the foreign key to the "non-owning" table.
 ForeignKey getJoinTableOwningForeignKey()
          Assuming the table is a "join" table, return the foreign key to the "owning" table.
 Column getPrimaryKeyColumn()
          Return the table's single primary key column.
 Schema getSchema()
          Return the table's schema.
 boolean isPossibleJoinTable()
          Return whether the table is possibly a "join" table (i.e.
 boolean joinTableNameIsDefault()
          Assuming the table is a "join" table, return whether its name matches the JPA default (i.e.
 java.util.Iterator<Column> primaryKeyColumns()
          Return the table's primary key columns.
 int primaryKeyColumnsSize()
          Return the number of primary key columns the table contains.
 java.util.Iterator<java.lang.String> sortedColumnIdentifiers()
          Return the table's column identifers, sorted by name.
 
Methods inherited from interface org.eclipse.jpt.db.DatabaseObject
getConnectionProfile, getDatabase, getIdentifier, getIdentifier, getName
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

getSchema

Schema getSchema()
Return the table's schema.


columns

java.util.Iterator<Column> columns()
Return the table's columns.


columnsSize

int columnsSize()
Return the number of columns the table contains.


getColumnNamed

Column getColumnNamed(java.lang.String name)
Return the column with specified name. The name must be an exact match of the column's name.

See Also:
getColumnForIdentifier(String)

sortedColumnIdentifiers

java.util.Iterator<java.lang.String> sortedColumnIdentifiers()
Return the table's column identifers, sorted by name.


getColumnForIdentifier

Column getColumnForIdentifier(java.lang.String identifier)
Return the column for the specified identifier. The identifier should be an SQL identifier (i.e. quoted when case-sensitive or containing special characters, unquoted otherwise).

See Also:
getColumnNamed(String)

primaryKeyColumns

java.util.Iterator<Column> primaryKeyColumns()
Return the table's primary key columns.


primaryKeyColumnsSize

int primaryKeyColumnsSize()
Return the number of primary key columns the table contains.


getPrimaryKeyColumn

Column getPrimaryKeyColumn()
Return the table's single primary key column. Throw an IllegalStateException if the table has more than one primary key column.


foreignKeys

java.util.Iterator<ForeignKey> foreignKeys()
Return the table's foreign keys.


foreignKeysSize

int foreignKeysSize()
Return the number of foreign keys the table contains.


isPossibleJoinTable

boolean isPossibleJoinTable()
Return whether the table is possibly a "join" table (i.e. it contains only 2 foreign keys). Whether the table *actually* is a "join" table is determined by the semantics of the database design.


getJoinTableOwningForeignKey

ForeignKey getJoinTableOwningForeignKey()
Assuming the table is a "join" table, return the foreign key to the "owning" table.

See Also:
isPossibleJoinTable()

getJoinTableNonOwningForeignKey

ForeignKey getJoinTableNonOwningForeignKey()
Assuming the table is a "join" table, return the foreign key to the "non-owning" table.

See Also:
isPossibleJoinTable()

joinTableNameIsDefault

boolean joinTableNameIsDefault()
Assuming the table is a "join" table, return whether its name matches the JPA default (i.e. "OWNINGTABLE_NONOWNINGTABLE").

See Also:
isPossibleJoinTable()