maybe we are talking about different issues - I'll try to give a simple example.
let's say we have a web-application which has
Users and the
User entity has an association to an
Image Entity.
In all the webpages, I want to display the
Image (if the
User has one): so I'll set eager fetching on the association.
Now that's fine - whenever you use a criteria and join to the
User Entities the
Image entities will automatically be eager fetched - great! Developers don't have to write any code for this join and thus can't forget about it.
But now I have one administration page, where the admin should be presented with a simple list of a subset of
User-names and adresses for the purpose to send a plain old mail to their postal adress. In this very special case I don't need/want eager fetching of
Images. So it would be nice, if I could just turn it off for this one criteria.
Of course there are alternatives:
- use HQL: it'll ignore the global eager fetching anyway
- set the global eager fetching to false: then you had to change all existing criterias that had implicitly joined to the Images before: involves very error prone refactoring.
- and maybe the getTypes() stuff that I haven't tested (yet)
[/list][i][/code]