What is the difference between Immediate fetching and Lazy collection fetching?

In Immediate fetching an association, collection or attribute is retrieved at the same time when the owner is loaded.
But in Lazy collection fetching, a collection is fetched only when an operation is invoked on that collection by client application.

This is the default fetching strategy for collections in Hibernate.

Lazy fetching is better from performance perspective.

Leave a Reply

Your email address will not be published. Required fields are marked *