Category: Maven
-
JPA One to One Bi Directional Mapping using MySQL and Hibernate
In the last post we saw how to define OnetoOne mapping using JPA but it was unidirectional, which means when we load Employee we can see EmployeeAddress but vise-versa is not true. Today we will update our mapping so that if we fetch EmployeeAddress we can obtain related Employee. Our Employee.java will remain as it…
-
JPA Unidirectional One to One Mapping using MySQL
In this tutorial we will explore how to map two entities. Say we have two entity Employee and Address, every employee will have one associated address, association will look like: JPA supports multiple types of mapping, in this tutorial we will see how to do “Uni-Directional” One to One Mapping. First we will setup our…