-->
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: HQL performance
PostPosted: Sat Jun 26, 2004 2:52 pm 
Newbie

Joined: Sat Jun 26, 2004 2:46 pm
Posts: 1
All yo hibernate Gurus,
Hi ,
I am lookinng into some performance tuning of a query .The scenario is i retrieve some ids iterating over a list and pass them to a query as parameter so there are as many queries as iterations .Can i have a list directly passed to a query as a parameter and return the List at once.
The code snippet is as under:
/* public Map findEmployeeCollection(int instCode) throws DaoException
{
log.warn("Entering method findEmployeeCollection");
Map map = new HashMap();
Ccs11119PensionData ccs11119PensionData;
List aList = null;
Iterator iterator = null;
List employeeList = null;
int iEmployeeId =0 ;
Employee employee = null;

try{

employeeList = pensiondata11119.findIEmpoyeeID(instCode);

for(int i =0;i<employeeList.size();i++)
{
ccs11119PensionData = (Ccs11119PensionData)employeeList.get(i);
iEmployeeId = Integer.parseInt(ccs11119PensionData.getId());

aList = session.createQuery(
"from Employee as employee where employee.iemployeeid =" +
iEmployeeId
).list();
iterator = aList.iterator();
iterator.hasNext();
employee = (Employee)iterator.next();
count++;
map.put(new Integer(iEmployeeId),employee);
}

}
catch(HibernateException hex)
{
log.warn("caught exception "+hex);
}
log.warn("Exiting method findEmployeeCollection");
return map;

}*/


Any help will be highly appreciated.
Thanks in anticipation,


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 28, 2004 12:27 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Code:
from Employee as employee where employee.iemployeeid in :idlist

_________________
Emmanuel


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.