|
Thanks for the clarification. This is a different issue from
HHH-1076
. p.children2 has duplicate records in it after this query. This means that the test_parent objects themselves are broken after this query due to their multiplied children. The issue here is not a mere duplication of results from the SELECT query that would be easily worked around by wrapping them in a set.
A significant implication of this defect in a pure JPA environment is that Hibernate does not let a user retrieve an object with one child list and one other child collection and fully initialize the child collections at the same time.
Working around this issue in a JPA environment requires either not using lazy lists for relationships or manual initialization (via additional queries) by calling size().
|