org.eclipse.jpt.db
Interface ForeignKey

All Superinterfaces:
java.lang.Comparable<ForeignKey>

public interface ForeignKey
extends java.lang.Comparable<ForeignKey>

Database foreign key 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.


Nested Class Summary
static interface ForeignKey.ColumnPair
          Pair up the foreign key's column pairs, matching each "base" column with the appropriate "referenced" column.
 
Method Summary
 java.util.Iterator<Column> baseColumns()
          Return the foreign key's "base" columns.
 ForeignKey.ColumnPair columnPair()
          Return the foreign key's single column pair.
 java.util.Iterator<ForeignKey.ColumnPair> columnPairs()
          Return the foreign key's column pairs.
 int columnPairsSize()
          Return the size of the foreign key's column pairs.
 boolean defaultMatchesJavaFieldName(java.lang.String javaFieldName)
          Return whether the foreign key's default Java field name matches the specified Java identifier, respecting the database's case-sensitivity.
 Table getBaseTable()
          Return the foreign key's "base" table.
 java.lang.String getJavaFieldName()
          Return a Java-appropriate name for a field that holds the entity mapped to the foreign key's "referenced" table.
 java.lang.String getName()
          Return the foreign key's name.
 Table getReferencedTable()
          Return the foreign key's "referenced" table.
 boolean isDefaultFor(java.lang.String javaFieldName)
          Return whether the foreign key is the default for the specified Java field name, respecting the database's case-sensitivity.
 java.util.Iterator<Column> nonPrimaryKeyBaseColumns()
          Return the foreign key's "base" columns that are not part of the base table's primary key.
 java.util.Iterator<Column> referencedColumns()
          Return the foreign key's "referenced" columns.
 boolean referencesSingleColumnPrimaryKey()
          Return whether the foreign key references the primary key of the "referenced" table and that primary key has only a single column.
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

getName

java.lang.String getName()
Return the foreign key's name.


getBaseTable

Table getBaseTable()
Return the foreign key's "base" table.


getReferencedTable

Table getReferencedTable()
Return the foreign key's "referenced" table.


columnPairs

java.util.Iterator<ForeignKey.ColumnPair> columnPairs()
Return the foreign key's column pairs.

See Also:
ForeignKey.ColumnPair

columnPair

ForeignKey.ColumnPair columnPair()
Return the foreign key's single column pair. Throw an IllegalStateException if the foreign key has more than one column pair.


columnPairsSize

int columnPairsSize()
Return the size of the foreign key's column pairs.

See Also:
ForeignKey.ColumnPair

baseColumns

java.util.Iterator<Column> baseColumns()
Return the foreign key's "base" columns.

See Also:
ForeignKey.ColumnPair

nonPrimaryKeyBaseColumns

java.util.Iterator<Column> nonPrimaryKeyBaseColumns()
Return the foreign key's "base" columns that are not part of the base table's primary key.

See Also:
ForeignKey.ColumnPair

referencedColumns

java.util.Iterator<Column> referencedColumns()
Return the foreign key's "referenced" columns.

See Also:
ForeignKey.ColumnPair

getJavaFieldName

java.lang.String getJavaFieldName()
Return a Java-appropriate name for a field that holds the entity mapped to the foreign key's "referenced" table.


defaultMatchesJavaFieldName

boolean defaultMatchesJavaFieldName(java.lang.String javaFieldName)
Return whether the foreign key's default Java field name matches the specified Java identifier, respecting the database's case-sensitivity.


isDefaultFor

boolean isDefaultFor(java.lang.String javaFieldName)
Return whether the foreign key is the default for the specified Java field name, respecting the database's case-sensitivity.


referencesSingleColumnPrimaryKey

boolean referencesSingleColumnPrimaryKey()
Return whether the foreign key references the primary key of the "referenced" table and that primary key has only a single column.