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
but If I do mary.getSubordinates() it doesn't return to me nothing.
What is the problem?
Can you paste the code of the setSuperior method?
I guess that there is the problem, the insertion.
when you do: "john.SetSuperior(mary)" in data base you have to insert mary as john's superior (it seems that works) and also you have to insert john as mary's subordinates.
The problem is your data base, the update, insertion, and then.
if you want send the code, and I'll check it