Java Reference
In-Depth Information
Annotation
Description
Annotation Elements
@ManyToOne
Defines a single-valued
association to another entity
class that has many-to-one
multiplicity.
targetEntity
(optional): This is
the entity class that is the target of the
association.
cascade
(optional): These are the
operations that must be cascaded to the
target of the association. By default no
operations are cascaded.
fetch
(optional): The fetch strategy. By
default, the value is
EAGER
.
optional
(optional): Specifies whether
the association is optional. By default, the
value is true.
@ManyToMany
Defines a many-valued
association with many-to-
many multiplicity.
targetEntity
(optional): This is
the entity class that is the target of the
association. If the collection is defined
using generics the target entity is not
required to be specified.
cascade
(optional): These are the
operations that must be cascaded to the
target entity. By default, no operations
are cascaded.
fetch
(optional): This is the fetch
strategy. By default, it is
LAZY
.
mappedBy
(optional): Specified on the
non-owning side, the field that owns
the relationship. Required unless the
relationship is unidirectional.
Search WWH ::
Custom Search