Hi,
I have a M:M symmetric relationship, that is a relationship where the role name and POJO type are the same on both sides.
For example, suppose the POJO is Person and the role is family, in code this would look like this:
@Entity
public class Person {
private List <Person> family;
@ManyToMany(mappedBy="family")
public List <Person> getFamily(){
return family;
}
public void setFamily(List <Person> family){
this.family
}
}
However upon start up this will yield the exception:
javax.persistence.PersistenceException: org.hibernate.AnnotationException: Illegal use of mappedBy on both sides of the relationship: Person.family.
Does hibernate support this type of relationship?
|