注释接口 JoinTable
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.
-
嵌套类概要
嵌套类修饰符和类型类说明static @interfacestatic @interface -
可选元素概要
可选元素修饰符和类型可选元素说明booleanShould the middle table row be cascade deleted when the source object is deleted.booleanShould the middle table row be cascade deleted when the target object is deleted.booleanIn general, if entities on either side support logical deletion, middle tables should also support logical deletion.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.booleanbooleanboolean
-
元素详细资料
-
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 thaninverseJoinColumns()inverseJoinColumns()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()- 默认值:
{}
-
inverseJoinColumns
JoinColumn[] inverseJoinColumnsThe 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 columninverseJoinColumnName()- 默认值:
{}
-
readonly
boolean readonly- 默认值:
false
-
preventDeletionBySource
boolean preventDeletionBySource- 默认值:
false
-
preventDeletionByTarget
boolean preventDeletionByTarget- 默认值:
false
-
cascadeDeletedBySource
boolean cascadeDeletedBySourceShould the middle table row be cascade deleted when the source object is deleted.This argument cannot be true when `preventDeletionBySource` is true
This argument is used config the database-level cascade deletion for foreign key in middle table. for foreign key in entity table, please view
DissociateAction.LAX- 返回:
- Should the middle table row be cascade deleted when the source object is deleted.
- 默认值:
false
-
cascadeDeletedByTarget
boolean cascadeDeletedByTargetShould the middle table row be cascade deleted when the target object is deleted.This argument cannot be true when `preventDeletionByTarget` is true
This argument is used config the database-level cascade deletion for foreign key in middle table. for foreign key in entity table, please view
DissociateAction.LAX- 返回:
- Should the middle table row be cascade deleted when the target object is deleted.
- 默认值:
false
-
deletedWhenEndpointIsLogicallyDeleted
boolean deletedWhenEndpointIsLogicallyDeletedIn general, if entities on either side support logical deletion, middle tables should also support logical deletion. Otherwise, error will be raised.When entity on either side is logically deleted, the rows of middle tables should be logically deleted too.
However, if you don't want intermediate table records to support soft deletion, turn this switch on. When an object at either side is logically deleted, the corresponding middle table records will be physically deleted.
- 默认值:
false
-
filter
JoinTable.JoinTableFilter filter- 默认值:
@org.babyfish.jimmer.sql.JoinTable.JoinTableFilter(columnName="<illegal-column-name>", values={})
-
logicalDeletedFilter
JoinTable.LogicalDeletedFilter logicalDeletedFilter- 默认值:
@org.babyfish.jimmer.sql.JoinTable.LogicalDeletedFilter(columnName="<illegal-column-name>")
-