Hello Catalina,

> If you define ToMany fetch type to EAGER, then a simple
>    select a from A
> will get all Bs and Cs loaded.

unfortunately, using EAGER does not solve the (N+1)-problem. If there are L 
instances of A each
holds M instances of B and each b has N instances of C then there will be L*M*N 
queries
generated to get the instances of C.
In the case that we need to solve here, there are about L=100, M=15, N=2 and 
there's even one
more level D with about 2 instances per each c. So there are about 6000 
queries, to get
information that can be fetched in one single select.

Michael


Reply via email to