I have this error
mappedBy reference an unknown target entity property
I know what is the problem is that I should make the mappeby value "person" istead of person1 and person2 but the probleme is that I have 2 variable of type person (person1,person2) in class Contact I can't name them the same name !
in class Person
@OneToMany(cascade = CascadeType.ALL,fetch = FetchType.LAZY, mappedBy = "person")
private Set<Contact> contact = new HashSet<>();
in class Contact
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "id_person", nullable = false)
private Person person1;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "id_person", nullable = false)
private Person person2;
my MCD : enter image description here