Package javax.persistence
Annotation Type ForeignKey
-
@Target({}) @Retention(RUNTIME) public @interface ForeignKey
The ForeignKey annotation is used in schema generation. It is used to define a foreign key constraint or to override or disable the persistence provider’s default foreign key definition.- Since:
- JPA 2.1
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description StringforeignKeyDefinition(Optional) The foreign key constraint definition.Stringname(Optional) The name of the foreign key constraint.ConstraintModevalue(Optional) Used to specify whether a foreign key constraint should be generated when schema generation is in effect.
-
-
-
-
foreignKeyDefinition
String foreignKeyDefinition
(Optional) The foreign key constraint definition. Default is provider defined. If the value of disableForeignKey is true, the provider must not generate a foreign key constraint.- Returns:
- The foreign key definition
- Default:
- ""
-
-
-
value
ConstraintMode value
(Optional) Used to specify whether a foreign key constraint should be generated when schema generation is in effect.- Returns:
- mode
- Default:
- javax.persistence.ConstraintMode.CONSTRAINT
-
-