We have a fairly complicated tree structure where we would like toplink essentials to fetch the whole tree as fast as possible. The structure is something like this:
Level1 has a Collection
Level2 has a Collection
Level3 has a Collection
The levels above are entities and the FetchType for the children is EAGER.
When we look at the actual sql toplink generates db(Oracle), we see that the eager doesn't seem to affect the queries as expected. It makes two identical selects and not a join. Hence, the children aren't fetched and are (later) retrieved lazily with 1 select per child (slooow).
We use static weaving, which works fine. (and doesn't make any difference when disabling it)
What are we doing wrong?