When using the Java Persistence API (JPA) it is often necessary to create relationships between two entities. These relationships are…