注释接口 JoinColumn
@Retention(RUNTIME)
@Target(allowedTargets=PROPERTY)
@Target(METHOD)
@Repeatable(JoinColumns.class)
public @interface JoinColumn
Optional annotation to specify the column name for foreign key properties,
that means many-to-one or one-to-one property which is neither reversed
(with `mappedBy`) nor based on middle table.
If the column name inferred according to the Java/Kotlin property name based on Rule `word1Word2...WordN -> WORD1_WORD2_..._WORDN_ID` is different from the column name in the database, or the foreign key is fake(Not a real foreign key constraint in the database, but a concept only in the minds of developers), this annotation must be used.
Note: This annotation can only be used to map foreign key.
For scalar column, Column is useful
-
可选元素概要
可选元素修饰符和类型可选元素说明If ture(default), the foreign key is real, that means it a real foreign key constraint in the database Otherwise, the foreign key is fake, which is not a real foreign key constraint in database but a concept only in the minds of developersA column name of foreign keyA column name of the primary key of the parent table referenced by the foreign key
-
元素详细资料
-
name
String nameA column name of foreign key- 默认值:
""
-
referencedColumnName
String referencedColumnNameA column name of the primary key of the parent table referenced by the foreign keyCurrently, Jimmer's foreign keys do not support referencing non-primary key columns of the target table. Therefore, this configuration should not be used unless the foreign key consists of multiple columns.
- 默认值:
""
-
foreignKeyType
ForeignKeyType foreignKeyType- If ture(default), the foreign key is real, that means it a real foreign key constraint in the database
- Otherwise, the foreign key is fake, which is not a real foreign key constraint in database but a concept only in the minds of developers
- 默认值:
AUTO
-