In my project i have a Professor, a student and a group classes .In my project : the professor and the students have a lot in common the only difference between them is in the methods and the relation with the group class so i thought about inheritance and creating a person abstract class.
i was first confused between the three mapping choices but i finally choose the joined one
but i don't know how to create the relations between the professor and the group (bidirectionnal ManyToMany) and the student and the group(ManyToOne and OneToMany).
i am used to map entities without the inheritance :now with this i am so confused .
edit (i am tunisian and we use french in our education)
@Entity
public class Etudiant {
private int cin;
private String nom;
private String prenom;
private String email;
private String motDePase;
private String imageProfil;
and this a part of the professor class
@Entity
public class Professeur {
private int cin;
private String nom;
private String prenom;
private String email;
private String motDePasse;
private String imageProfil;
i didn't create the person class yet i only created professor , student and group i first tried to work without the inheritance but then it was a duplicate code just a waste so i'm trying to figure out my way through the inheritance