注释接口 OneToOne
-
可选元素概要
可选元素修饰符和类型可选元素说明booleanThis argument cannot be specified when `mappedBy` is specified!The property that owns the association.
-
元素详细资料
-
mappedBy
String mappedByThe property that owns the association. Required unless the relationship is unidirectional. Here is the English translation:Once `mappedBy` is specified, the current property is just a mirror of the property in the opposite entity that truly owns this association. Do not use `@JoinColumn` or `@JoinTable` for association mapping.
Unlike JPA, for bidirectional associations, Jimmer allows developers to arbitrarily decide which side to be `mappedBy` side, which does not affect save behaviors.
- 返回:
- A property name of associated entity.
- 默认值:
""
-
inputNotNull
boolean inputNotNullThis argument cannot be specified when `mappedBy` is specified!Sometimes, the foreign key in the database is not null, but the developer has to declare the many-to-one property as a nullable property in the entity type.
Global filter is a typical scenario. Although the non-null foreign key in the database indicates that the parent object exists absolutely, once the filtering behavior is applied to the class to which the parent object belongs, it is still possible that no parent object data can be found.
At this time, in order to cope with the query business, we hope to set a many-to-one association as nullable, but we still hope that the user must specify a non-null parent object in save business. At this time, you can specify the `inputNotNull` of this annotation.
- 默认值:
false
-