Annotation Type JoinTable
-
@Retention(RUNTIME) @Target(FIELD) public @interface JoinTable
Indicates a many to many relationship.
A join table will be created, using the specified table name and column name.
If it exists several many to many relationships between the two same entities, the tableName or joinProperty can be used to avoid ambiguity.
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description StringcolumnNameSpecifies the name of the column to use in the join table to store the foreign key to this entity.StringjoinPropertySpecifies the property on the linked entity to use for the join.StringtableNameSpecifies the table name to use for the join.
-
-
-
Element Detail
-
tableName
String tableName
Specifies the table name to use for the join. By default the name is generated by concatenating the name of the two tables.- Default:
- ""
-
-
-
columnName
String columnName
Specifies the name of the column to use in the join table to store the foreign key to this entity. By default the name of the entity table is used.- Default:
- ""
-
-
-
joinProperty
String joinProperty
Specifies the property on the linked entity to use for the join.- Default:
- ""
-
-