-->
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.  [ 2 posts ] 
Author Message
 Post subject: How to use maxSize when fetching collection, JPA
PostPosted: Fri Nov 21, 2014 6:08 am 
Newbie

Joined: Fri Nov 21, 2014 5:36 am
Posts: 1
Hello,

Hibernate 4.3.6, JPA.
As I understand it, when I create a query that fetch sub collection, Hibernate needs to fetch all the entity even if I put a maxSize.
I understand it is necessary as the number of row is multiplied by the element in the collection and thus setting the limit to maxSize will not fetch enough entities.

So the questions are :
- In configuration, is it possible to tell hibernate to fetch first the ids of the elements (so it can use the limit), then fetch the entity
- In configuration, Is it possible to tell hibernate to fetch 10 row at a time and stop when it gets enough
- Is there any other way i don't know

The problem is I have a lot of entities, so it degrade the performance !

Thank you very much,
Jean


Top
 Profile  
 
 Post subject: Re: How to use maxSize when fetching collection, JPA
PostPosted: Wed Nov 26, 2014 10:28 am 
Newbie

Joined: Wed Nov 26, 2014 10:27 am
Posts: 1
I have this exact same problem.

If I remove the fetch I get my "fetch first" block back as expected. Have you found a way around this?


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

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.