|
problems with JPA
I have an entity named Employee
the employee has a name, and a collection of "superiors" and collection of "subordinates"
I have 2 tables:
table A= where I save the id and the name
table B= where I save the id, one to the subordinate and the other to the superior
So, If I have an user named "John" and other named "Mary"
I do something like that
john.setSuperior(Mary) that is to say that john is Mary's subordinate
the tables have a many to many relationship
when I search "john" y do "getSuperiors()" and it returns to me
Mary
but If I do mary.getSubordinates() it doesn't return to me nothing.
What is the problem?
|