Home » Search

About OneToOne

1-10 of 62Refresh
Manual
92

JPA Entity Fields

: OneToOne, ManyToOne - for references of entity types. OneToMany, ManyToMany - for collections ... EntityWithFieldSettings { @Basic(optional=false) Integer field1; @OneToOne(cascade ... { @OneToOne MedicalInsurance medicalInsurance; } @Entity public class MedicalInsurance
JPA Doc
89

javax.persistence.OneToOne

javax.persistence Annotation OneToOne Target: Fields (including property get methods) When using ... . If the relationship is bidirectional, the non-owning side must use the mappedBy element of the OneToOne annotation to specify the relationship field or property of the owning side. The OneToOne annotation
JPA Doc
79

OneToOne.cascade

Annotation Element javax.persistence.OneToOne CascadeType[] cascade (Optional) The operations that must be cascaded to the target of the association. By default no operations are cascaded. Default value: {} Since: JPA 1.0
JPA Doc
79

OneToOne.fetch

Annotation Element javax.persistence.OneToOne 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
JPA Doc
79

OneToOne.mappedBy

Annotation Element javax.persistence.OneToOne String mappedBy (Optional) The field that owns the relationship. This element is only specified on the inverse (non-owning) side of the association. Default value: "" Since: JPA 1.0
JPA Doc
79

OneToOne.optional

Annotation Element javax.persistence.OneToOne boolean optional (Optional) Whether the association is optional. If set to false then a non-null relationship must always exist. Default value: true Since: JPA 1.0
JPA Doc
79

OneToOne.orphanRemoval

Annotation Element javax.persistence.OneToOne boolean orphanRemoval (Optional) Whether to apply the remove operation to entities that have been removed from the relationship and to cascade the remove operation to those entities. Default value: false Since: JPA 2.0
JPA Doc
79

OneToOne.targetEntity

Annotation Element javax.persistence.OneToOne 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 value: void.class Since: JPA 1.0
JPA Doc
57

JPA Annotations for Relationships

Reference (JavaDoc) of JPA 2 relationship annotations, including @ManyToMany, @ManyToOne, @OneToMany, @OneToOne, @OrderBy and @MapKey.
Manual
30

Deleting JPA Entity Objects

can be referenced by a collection field): @Entity class Employee { : @OneToOne ... cascading mode which can be specified using the orphanRemoval element of the @OneToOne and @OneToMany annotations: @Entity class Employee { : @OneToOne(orphanRemoval=true) private