(javax.persistence) Annotation Type
Optional Element Summary
CascadeType[] | cascade (Optional) The operations that must be cascaded to the target of the association. |
FetchType | fetch (Optional) Whether the association should be lazily loaded or must be eagerly fetched. |
String | mappedBy (Optional) The field that owns the relationship. |
boolean | optional (Optional) Whether the association is optional. |
Class | targetEntity (Optional) The entity class that is the target of the association. |
targetEntity
public abstract Class targetEntity
(Optional) The entity class that is the target of the association.
Defaults to the type of the field or property that stores the association.
Default:void.class
cascade
public abstract CascadeType[] cascade
(Optional) The operations that must be cascaded to the target of the association.
By default no operations are cascaded.
Default:{}
fetch
public abstract FetchType fetch
(Optional) Whether the association should be lazily loaded or must be eagerly fetched. The EAGER strategy is a requirement on the persistence provider runtime that the associated entity must be eagerly fetched. The LAZY strategy is a hint to the persistence provider runtime.Default:EAGER
optional
public abstract boolean optional
(Optional) Whether the association is optional. If set to false then a non-null relationship must always exist.Default:true
mappedBy
public abstract String mappedBy
(Optional) The field that owns the relationship. This element is only specified on the inverse (non-owning) side of the association.Default:""