Annotation Type ManyToOne
Maps a single related entity using a foreign key on the owning table.
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionChooses operations to propagate to related entities.Controls relationship initialization.booleanAllows an owning to-one relationship to be null.
-
Element Details
-
fetch
FetchType fetchControls relationship initialization.- Returns:
- fetch policy; EAGER for to-one and LAZY for collections by default
- Default:
EAGER
-
cascade
CascadeType[] cascadeChooses operations to propagate to related entities.- Returns:
- cascade operations; empty by default
- Default:
{}
-
optional
boolean optionalAllows an owning to-one relationship to be null.- Returns:
- true by default; false makes the generated foreign key required
- Default:
true
-