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 Object Relational Mapping and the fly likes How to get a single database query? 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 » Databases » Object Relational Mapping
Bookmark "How to get a single database query?" Watch "How to get a single database query?" New topic
Author

How to get a single database query?

Adam Kreiss
Ranch Hand

Joined: Sep 12, 2005
Posts: 35
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

Joined: Jun 25, 2001
Posts: 15960
    
  19

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to get a single database query?
 
Similar Threads
Using html drop down box to retain values (in a jsp page)
Help me design this struts app , please
connection time out error
How to call stored procedures in ejb2.1?
DTO & DAO