Hibernate version: 3.2GA
DataBase: postgresql 8.1.5
Hi all,
I need some advice I have this object: Parent who has a collection of children, pretty much like this:
Code:
class Parent {
...
List getChildren() {
}
...
}
Children collection is lazy, and I want to write an HQL query to initialize the parentalong
with his children:
I've tried 2 solutions.
First:
Code:
from Parent as p inner join fetch p.children
But this wont return any Parent without children.
I've also tried:
Code:
from Parent as p left outer join fetch p.children
But this would result in repeated Parent's on the list (once for every child).
Is there any other way of achieving this? Am I missing something?
Thanks in advance,
Miguel.
edit: I missed the fetch part of the second query