I have a class A and want to load all objects of that class using Hibernate. The class has a few collections which I've mapped.
Code:
Class A {
Collection<B> bs;
Collection<C> cs;
Collection <D> ds;
}
I have tried using join fetching strategy for the collections and that works OK but I thought subselect might perform better as the join fetching results in a large cartesian product.
My problem is subselect fetching is slow because there is a complicated where clause generated for each collection, however I don't need any where clause because I just want to load all objects of the collection classes B, C etc.
Is it possible to give Hibernate some sort of "hint" about the where clause for the collections loading?