Hibernate - What is lazy initialization in hibernate?

What is lazy initialization in hibernate?

- The delaying the object creation or calculating a value or some process until the first time it is needed. The retrieval of particular information only at the time when the object is accessed, is lazy initialization in hibernate. A scenario for lazy initialization is:

- When the field creation is expensive, a field may or may not be invoked.

- In this scenario the creation of a field can be deferred until the actual moment is arise to use it. The performance is increased using this technique, by avoiding unnecessary creation of objects which is expensive and consumes the memory space.

What is lazy initialization in hibernate?

- Lazy loading in Hibernate means fetching and loading the data, only when it is needed, from a persistent storage like a database. Lazy loading improves the performance of data fetching and significantly reduces the memory footprint.
Hibernate - What is lazy fetching in hibernate?
What is lazy fetching in hibernate? - Lazy fetching is associated with child objects loading for its parents..
Hibernate - Difference between sorted and ordered collection
Difference between sorted and ordered collection in hibernate - The sorted collection is a collection that is sorted using the Java collections framework....
Hibernate - Difference between transient and detached objects
Difference between transient and detached objects - Transient objects do not have association with the databases and session objects...
Post your comment