注释接口 OneToOne
@Documented
@Retention(RUNTIME)
@Target(allowedTargets=PROPERTY)
@Target(METHOD)
public @interface OneToOne
-
可选元素概要
可选元素修饰符和类型可选元素说明booleanThis argument cannot be specified when `mappedBy` is specified!
-
元素详细资料
-
mappedBy
String mappedBy- 默认值:
""
-
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
-