View Single Post
  #1 (permalink)  
Old 06-25-2007, 09:32 PM
Ed Ed is offline
Senior Member
 
Join Date: Jun 2007
Posts: 110
Ed is on a distinguished road
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?
Reply With Quote
Sponsored Links