注释接口 JoinTable
This annotation should typically be used with
ManyToMany,
but it can also be used with ManyToOne or OneToOne.
The annotation cannot be used by the reversed(with `mappedBy`) property
The middle table should only have two columns:
- one pointing to the foreign key of the entity in which the current property resides
- and the other pointing to the foreign key of the entity returned by the current property
-
For many-to-many associations,
if you want to add more business fields to the middle table,
this annotation is no longer applicable, please use
ManyToManyView - For many-to-one associations, unique constraint should be added to the foreign key pointing to the entity in which the current property resides.
- For one-to-one associations, unique constraint should be added to each foreign key.
-
可选元素概要
可选元素修饰符和类型可选元素说明The column names of the foreign key of the entity returned by the current propertyThe column names of the foreign key of the entity returned by the current propertyThe column name of the foreign key of the entity in which the current property residesThe column name of the foreign key of the entity in which the current property residesMiddle table name.
-
元素详细资料
-
name
String nameMiddle table name.If it is not specified, it will be determined by Jimmer. For example, If the current entity is `Book` and the target entity is `Author`, the default middle table name is `BOOK_AUTHOR_MAPPING`
- 默认值:
""
-
joinColumnName
String joinColumnNameThe column name of the foreign key of the entity in which the current property residesThis argument cannot be specified together with
It is better thanjoinColumns()joinColumns()when foreign key is real database constraint and has only one column- 默认值:
""
-
inverseJoinColumnName
String inverseJoinColumnNameThe column names of the foreign key of the entity returned by the current propertyThis argument cannot be specified together with
It is better thaninverseColumns()inverseColumns()when foreign key is real database constraint and has only one column- 默认值:
""
-
joinColumns
JoinColumn[] joinColumnsThe column name of the foreign key of the entity in which the current property residesThis argument cannot be specified together with
This argument must be configured when foreign key * is not real database constraint or has only more than 1 columnsjoinColumnName()- 默认值:
{}
-
inverseColumns
JoinColumn[] inverseColumnsThe column names of the foreign key of the entity returned by the current propertyThis argument cannot be specified together with
This argument must be configured when foreign key is not real database constraint or has only more than 1 columnsinverseJoinColumnName()- 默认值:
{}
-