Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to get a single database query?

 
Adam Kreiss
Ranch Hand
Posts: 35
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

I'm trying to set up the mappings between a number of tables. I'd like to be able to retrieve them (or large sections of them) with one call to the database instead of one call for each relationship. Is there any way to get Hibernate to do this?

Thanks

- Adam
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17628
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, that's what "eager" fetching is all about. Hibernate prefers "lazy" fetches, because complex tables with lots of relationships can potentially drag in the world and its dog and load all of it into memory at once. However, you can tweak the fetch process if you know that certain relationships will always go together.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic