Annotation Type ForeignKeyEntity
@Target(FIELD)
@Retention(RUNTIME)
public @interface ForeignKeyEntity
Marks a field as the correspondent object to a foreign key.
This property does not have to exist on the database.
Its parameter is the name of the foreign key column.
This annotation can be used on two types of objects:
1) Entities which represent real objects of foreign key tables. In this case the entity has to extend
BaseEntity. Because this entity represents a table it should extend BaseEntity anyway.
2) Foreign keys to a table with static values that can be represented by an enum because they don't change.
In that case the enum must extend IdentifiableEnum and map the ids from the table.- Author:
- Collin Alpert
-
Required Element Summary
Required Elements Modifier and Type Required Element Description java.lang.Stringvalue
-
Element Details
-
value
java.lang.String value
-