Name and version of the database you are using:
Some of our criteria queries involve collection joining. To avoid duplicates, i.e. get distinct root entities, we use:
which does the job.
We also do some eager fetching (to avoid expensive roundtrips on our WAN), e.g.:
Finally, we limit the result set:
However, the result set may contain less elements as specified by hits, which is the problem. I suppose that setMaxResults() is applied to the list before the transformer gets a hand on it.
I've read the book and searched the forum for an answer to this problem but didn't find one (I don't want to do plain HQL or SQL).
Any help would be much appreciated.