Say I execute the query below
Code:
from Parent p join fetch p.child c
And I call query.list() on it. Assume the parent has two records. Parent 1 has three child records, and Parent 2 has two. I expect to get a list back of size two containing the two parents (with their children populated). Instead I get a list of size five with the parents repeated multiple times. Parent 1 is repeated three times and Parent 2 twice, I assume because that's how many children they have.
Is this the correct behavior? I am new to Hibernate, and have not found an answer to this question. What I want is a list without repeats.