This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Blog around the Campfire and the fly likes Simple Hibernate Eager Loading Example Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Other » Blog around the Campfire
Bookmark "Simple Hibernate Eager Loading Example" Watch "Simple Hibernate Eager Loading Example" New topic
Author

Simple Hibernate Eager Loading Example

Christopher Rygaard
Ranch Hand

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

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

These persistent classes are nearly identical to those in the lazy loading example I posted earlier. The only difference is the annotation on Container._children.

The bit that illustrates the eager 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 eager loading. It is identical to the lazy loading example I posted earlier, except there are no expected errors.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Simple Hibernate Eager Loading Example
 
Similar Threads
Simple Hibernate Container Example
Simple Hibernate Example with Inner Classes
Simple Hibernate Lazy Loading Example
Simple Hibernate Example with Final Classes and Final Methods
Simple Hibernate Cascade Save Example