Package javax.jdo.annotations
Annotation Type ForeignKey
@Target({TYPE,FIELD,METHOD})
@Retention(RUNTIME)
@Repeatable(ForeignKeys.class)
public @interface ForeignKey
Annotation for a database foreign-key.
Corresponds to the xml element "foreign-key".
- Since:
- 2.1
- Version:
- 2.1
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionColumn[]
Columns that compose this foreign key.Whether this foreign key is deferred (constraint is checked only at commit).The delete action of this foreign key.Vendor extensions.String[]
Member (field and property) names that compose this foreign key.Name of the foreign key.Table for the foreign key.Whether this foreign key is unique.The update action of this foreign key.
-
Element Details
-
name
String nameName of the foreign key.- Returns:
- the name of the foreign key
- Default:
""
-
table
String tableTable for the foreign key. This is needed iff annotating a type where the foreign key is not defined on the primary table for the type.- Returns:
- the table on which the foreign key is defined
- Default:
""
-
deferred
String deferredWhether this foreign key is deferred (constraint is checked only at commit).- Returns:
- whether this foreign key is deferred
- Default:
""
-
unique
String uniqueWhether this foreign key is unique.- Returns:
- whether this foreign key is unique
- Default:
""
-
deleteAction
ForeignKeyAction deleteActionThe delete action of this foreign key.- Returns:
- the delete action of this foreign key
- Default:
RESTRICT
-
updateAction
ForeignKeyAction updateActionThe update action of this foreign key.- Returns:
- the update action of this foreign key
- Default:
RESTRICT
-
members
String[] membersMember (field and property) names that compose this foreign key.- Returns:
- the member names that compose this foreign key
- Default:
{}
-
columns
Column[] columnsColumns that compose this foreign key.- Returns:
- the columns that compose this foreign key
- Default:
{}
-
extensions
Extension[] extensionsVendor extensions.- Returns:
- the vendor extensions
- Default:
{}
-