I would like to be able to programmatically enable/disable lazy loading at a certain table level. Normally, I prefer lazy loading. However, there are certain scenarios where I need to disable it for a Session (or a Transaction or .execute() call if necessary).
Is there a way to do this? If not, what is the recommend method of doing this?
Scenario:
In a certain query, I want to get a list of rows from TableA immediately (i.e. NOT lazily) -- without having to traverse through them, similar to how Hibernate 2 did it.
Later on, I want a different query to lazily get data from TableA and below.
Summary of table relationships:
Code:
TableA
TableB one-to-one
TableC one-to-many (set)
TableD one-to-many (set)
Hibernate 3.1.3
Java 1.5