In this section, you will know about the jpa relationship. JPA supports the relationship between entities.
There are following types of relationship:
JPA relationships are not bi-directional. JPA annotations are added to define the relationship. If, you want to make a relationship bi-directional to use a special attribute.
There are following types of cascade:
The property cascade = CascadeType.ALL indicates that when we persist, remove, refresh or merge this entity all the entities held in this field would be persist, remove, delete or update.
Recommend the tutorial