Annotation Type OneToMany
Maps a collection of related entities using a join table or an inverse mappedBy field.
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionChooses operations to propagate to related entities.Controls relationship initialization.Names the owning Java relationship field on the target entity.booleanDeletes a related entity removed from this one-to-one or one-to-many association at flush.
-
Element Details
-
fetch
FetchType fetchControls relationship initialization.- Returns:
- fetch policy; EAGER for to-one and LAZY for collections by default
- Default:
LAZY
-
cascade
CascadeType[] cascadeChooses operations to propagate to related entities.- Returns:
- cascade operations; empty by default
- Default:
{}
-
mappedBy
String mappedByNames the owning Java relationship field on the target entity.- Returns:
- owning field name, or empty for the owning side
- Default:
""
-
orphanRemoval
boolean orphanRemovalDeletes a related entity removed from this one-to-one or one-to-many association at flush.- Returns:
- true to delete orphans; false by default
- Default:
false
-