File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Blog around the Campfire and the fly likes Simple Hibernate Lazy Loading Example Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Other » Blog around the Campfire
Bookmark "Simple Hibernate Lazy Loading Example" Watch "Simple Hibernate Lazy Loading Example" New topic
Author

Simple Hibernate Lazy Loading Example

Christopher Rygaard
Ranch Hand

Joined: Feb 22, 2014
Posts: 42
    
    3
Lazy Loading Example

This is the simplest way to illustrate lazy loading that I could cook up.

These persistent classes are nearly identical to those in the Container example I posted earlier. The interesting part is the annotation on Container._children.

The bit that illustrates the lazy loading is in HibernateExample.main().

Notice: This is provided with no warranty whatsoever. Use at your own risk.

This is the contained class:

This is the container class:

This example illustrates lazy loading:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Simple Hibernate Lazy Loading Example