These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: How to fetch collection?
PostPosted: Fri Nov 07, 2008 1:27 am 
Newbie

Joined: Fri Nov 07, 2008 1:10 am
Posts: 1
Location: Russia
Hi! I'm just new to Hibernate. I've a question with fetching collections. I'm solving the following problem: ex. I've table User and it is associated with tables Address, Email, Phone. I need to get information about all users (about 1.000.000) so I need to retrieve some fields from associated tables (ex. Address.Street Address.City, etc.) for each user. Now it takes too many time because of number of queries to database. So I have an idea to reduce number of queries by fetching addresses, phones, emails in query where I get users, but it's impossible to do just like "... left outer join fetch user.addresses ..." because query is limited to get users by 1000 not to get OutOfMemory error.
Using Hibernate 3.2.6.ga and Hibernate annotations 3.3.0. Database - MySQL 5.0 (InnoDB)
Can you help me on how to solve this problem and reduce execution time?
Thank's a lot!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.