O'Reilly logo

Spring Persistence with Hibernate by Ahmad Seddighi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Lazy loading

Loading persistent objects from the database is an expensive operation, particularly when the objects are associated with many other objects. To enhance loading performance, Hibernate provides a great feature called lazy loading, which we saw briefly in Chapter 3. Let's look at it again, now that we know more about Hibernate's persistence functionality. Using lazy loading, Hibernate provides proxy objects, instead of actual persistent objects, whenever they are queried. The proxy objects act like the real object, but without the real values. This prevents Hibernate from unnecessary hitting the database, which would reduce the application's performance. The real values of the properties, object associations, and collections are loaded ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required