Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate Lazy Loading

 
Bai Shen
Ranch Hand
Posts: 323
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a way to turn off lazy loading for one class? I have a class that I almost always use with another class. So I want to have hibernate to load them both at the same time. But I don't need to do this with every object, just these two classes.

So far I've only found information on how to turn off lazy loading for the entire application.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lazy loading can be defined on class, property, association, component, and subclass levels--not sure how that could be missed with even a cursory read of the Hibernate mapping docs.

http://docs.jboss.org/hibernate/core/3.5/reference/en/html/mapping.html
 
Bai Shen
Ranch Hand
Posts: 323
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Huh. I guess my search terms were off.

Thanks.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No problem :) I almost always aim for the "official" docs first for stuff like this rather than relying on a web search--that's saved for the complicated stuff.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic