Hi,
I have a common problem here that I'm sure alot of people have seen. An Account entity with @ManyToMany relationship with Role. I marked the relationship to fetch as EAGER, as I typically would load the Account object and put it in the HttpSession. This would prevent a lazy fetch exception when I access Role sometime later in a different request.
The problem is when I use the criteria API to list all Accounts (say on an admin CRUD page), I get the Cartesian product of Account/Role. This can be fixed by using the DISTINCT_ROOT_ENTITY result transformer.
My question is, when using the distinct root entity transformer / criteria query on many-to-many relationships, does it eagerly fetch the relations for each of my distinct root entities?
Thanks[/code]
|