|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface 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.
| Nested Class Summary | |
|---|---|
static interface |
ForeignKey.ColumnPair
Pair up the foreign key's column pairs, matching each base column with the appropriate referenced column. |
| Field Summary |
|---|
| Fields inherited from interface org.eclipse.jpt.jpa.db.DatabaseObject |
|---|
DEFAULT_COMPARATOR, IDENTIFIER_TRANSFORMER, NAME_TRANSFORMER |
| Method Summary | |
|---|---|
java.lang.String |
getAttributeName()
Return an appropriate name for an attribute that holds the entity mapped to the foreign key's referenced table. |
java.lang.Iterable<Column> |
getBaseColumns()
Return the foreign key's base columns. |
Table |
getBaseTable()
Return the foreign key's base table. |
ForeignKey.ColumnPair |
getColumnPair()
Return the foreign key's single column pair. |
java.lang.Iterable<ForeignKey.ColumnPair> |
getColumnPairs()
Return the foreign key's column pairs. |
int |
getColumnPairsSize()
Return the size of the foreign key's column pairs. |
java.lang.String |
getDefaultAttributeName()
If the name of the base column adheres to the JPA spec for a default mapping (i.e. |
java.lang.String |
getJoinColumnAnnotationIdentifier(java.lang.String attributeName)
Given the name of an attribute (field or property) that is mapped to the foreign key, build and return a string to be used as the value for the attribute's @javax.persistence.JoinColumn annotation's
name element. |
java.lang.Iterable<Column> |
getNonPrimaryKeyBaseColumns()
Return the foreign key's base columns that are not part of the base table's primary key. |
java.lang.Iterable<Column> |
getReferencedColumns()
Return the foreign key's referenced columns. |
Table |
getReferencedTable()
Return the foreign key's referenced table. |
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 org.eclipse.jpt.jpa.db.DatabaseObject |
|---|
getConnectionProfile, getDatabase, getIdentifier, getIdentifier, getName |
| Method Detail |
|---|
Table getBaseTable()
Table getReferencedTable()
java.lang.Iterable<ForeignKey.ColumnPair> getColumnPairs()
int getColumnPairsSize()
ForeignKey.ColumnPair getColumnPair()
IllegalStateException if the foreign key has more than one column pair.
java.lang.Iterable<Column> getBaseColumns()
java.lang.Iterable<Column> getNonPrimaryKeyBaseColumns()
java.lang.Iterable<Column> getReferencedColumns()
boolean referencesSingleColumnPrimaryKey()
java.lang.String getAttributeName()
java.lang.String getDefaultAttributeName()
ForeignKey(EMP.CUBICLE_ID => CUBICLE.ID) => "CUBICLE"
Return null if it does not adhere to the JPA spec:
ForeignKey(EMP.CUBICLE_ID => CUBICLE.CUBICLE_ID) => null
ForeignKey(EMP.CUBICLE => CUBICLE.ID) => null
java.lang.String getJoinColumnAnnotationIdentifier(java.lang.String attributeName)
@javax.persistence.JoinColumn annotation's
name element. Return null if the attribute
maps to the join column by default.
Precondition: The foreign key consists of a single column pair whose referenced column is the single-column primary key of the foreign key's referenced table.
This is used by the entity generation code to determine whether a generated annotation must explicitly identify the join column or the calculated default adequately identifies the join column (taking into consideration case-sensitivity, special characters, etc.).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||