I am writing a query against a domain model where (for whatever reason) a one-to-many association is mapped with lazy="false". In my particular query, I'd rather fetch that collection lazily, because I don't care about its contents. How can I reenable laziness for my particular query? Is this possible at all?
So far, I looked at Criteria.setFetchMode
, but FetchMode.LAZY
is merely a deprecated alias for FetchMode.SELECT
...
Changing the mapping would probably be ideal, but I'd rather not risk affecting the existing queries.
Edit: We use Hibernate 3.3.2