when one entity is inside the another-one entity it is known as One-2-One Mapping.
- Fields (including property get methods)
- Defines a single-valued association to another entity that has one-to-one multiplicity. It is not normally necessary to specify the associated target entity explicitly since it can usually be inferred from the type of the object being referenced. If the relationship is bidirectional, the non-owning side must use the
mappedByelement of the @OneToOne annotation to specify the relationship field or property of the owning side.
- The @OneToOne annotation may be used within an embeddable class to specify a relationship from the embeddable class to an entity class.