Question: Hibernate Lazy Initialization
What is lazy initialization in hibernate?
In Lazy Loading, Hibernate engine loads only those objects that we are querying for and doesn't fetch associated entities.
In Hibernate, u can make lazy=true or lazy=false. Lazy initialization comes into play only when u deal with one to many or many to many relationships in database.
An attribute 'lazy' can be used to let Hibernate know if the associated entity or collection has to be lazily loaded or prefetched.
Lazy initialization improves performance by delaying the fetch from the database until the returned object is actually queried for the data.