org.eclipse.jpt.jpa.db
Interface Table

All Superinterfaces:
DatabaseObject

public interface Table
extends DatabaseObject

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.


Field Summary
 
Fields inherited from interface org.eclipse.jpt.jpa.db.DatabaseObject
DEFAULT_COMPARATOR, IDENTIFIER_TRANSFORMER, NAME_TRANSFORMER
 
Method Summary
 Column getColumnForIdentifier(java.lang.String identifier)
          Return the column for the specified identifier.
 Column getColumnNamed(java.lang.String name)
          Return the column with the specified name.
 java.lang.Iterable<Column> getColumns()
          Return the table's columns.
 int getColumnsSize()
          Return the number of columns the table contains.
 java.lang.Iterable<ForeignKey> getForeignKeys()
          Return the table's foreign keys.
 int getForeignKeysSize()
          Return the number of foreign keys the table contains.
 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.
 java.lang.Iterable<Column> getPrimaryKeyColumns()
          Return the table's primary key columns.
 int getPrimaryKeyColumnsSize()
          Return the number of primary key columns the table contains.
 Schema getSchema()
          Return the table's schema.
 java.lang.Iterable<java.lang.String> getSortedColumnIdentifiers()
          Return the table's column identifers, sorted by name.
 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.
 
Methods inherited from interface org.eclipse.jpt.jpa.db.DatabaseObject
getConnectionProfile, getDatabase, getIdentifier, getIdentifier, getName
 

Method Detail

getSchema

Schema getSchema()
Return the table's schema.


getColumns

java.lang.Iterable<Column> getColumns()
Return the table's columns.


getColumnsSize

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


getColumnNamed

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

See Also:
getColumnForIdentifier(String)

getSortedColumnIdentifiers

java.lang.Iterable<java.lang.String> getSortedColumnIdentifiers()
Return the table's column identifers, sorted by name.

See Also:
getColumnForIdentifier(String)

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), getSortedColumnIdentifiers()

getPrimaryKeyColumns

java.lang.Iterable<Column> getPrimaryKeyColumns()
Return the table's primary key columns.


getPrimaryKeyColumnsSize

int getPrimaryKeyColumnsSize()
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.


getForeignKeys

java.lang.Iterable<ForeignKey> getForeignKeys()
Return the table's foreign keys.


getForeignKeysSize

int getForeignKeysSize()
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()