Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Simple Hibernate Eager Loading Example

 
Christopher Rygaard
Ranch Hand
Posts: 42
3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic