-->
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: Batch Criteria query optimisation
PostPosted: Fri Jul 11, 2008 5:55 am 
Newbie

Joined: Fri Jul 11, 2008 5:33 am
Posts: 1
Hello all,

This is my first post so thank you for reading this.

Code:
I have a query that i would like to optimize a bit:

Criteria crit =  session.createCriteria(Etablishment.class);   
         
crit.setFetchMode("status", FetchMode.JOIN)
     .setFetchMode("Company", FetchMode.JOIN)
     .setFetchMode("diffusions", FetchMode.JOIN);
                etaList.addAll((crit.add(Restrictions.in("id",ids)).list()));



First of all, what do you think is best to do :
- Doing a IN restriction clause for something like 10 IDs)
- Fetching the elements for about ten times.

Is there a time when one method is better than the other?

-------------

i am fetching quite a lot of data for only a few data which i need for this batch, is there a way to optimize that?

i have the following object relations:

Etablishment --> Company --> HQ (an Etablishment) --> status (object)
Etablishment --> Company --> Code (String)
Etablishment --> name (String)
Etablishment --> diffusions(List)

So, i need only these objects to be load and not the rest.

Is it possible?

Thank you for your time.


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.