After doing a bit more reading, I think I have a better understanding of lazy loading. Please correct me if any of the below assumptions are incorrect.
- By default, Hibernate 3 will enable lazy loading/fetching for collections.
- If lazy loading is enabled for a collection, that collection can be explicitly populated in one of the following ways:
- Calling the get() method for the associated collection within the context of a transaction (ie. project.getContacts() )
- Using HQL to do an inner/outer fetch join.
I think my problem is that I was using the Hibernate Tools eclipse plugin to run HQL queries against my mappings, and that when I go to view the results, and I expand the collections, it populates the data at that time. I will have to run more tests by simply analyzing the return values in my java code to make sure my understanding is correct.
Thanks,