-->
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: HQL executing multiple times because of inner query
PostPosted: Wed Jun 13, 2007 11:22 am 
Newbie

Joined: Thu Apr 19, 2007 6:44 am
Posts: 1
Location: Hydrabad
Hi ,

I am working on spring and hibernate.I wrote a HQL query to fetch data which has a inner query.This is executing twice , suppose total records are 10 ,It's displaying 20(duplicate records).
If number of inner queries increasing , the execution will also increse.

When a statement

getHibernateTemplate.find(query.toString) comes .here only it executes multiple times.

If you take one query and execute it will work fine.
I am using parameterised constructor.

Please tell me it is problem of mapping files or query.
[code]

StringBuffer brokerSummary = new StringBuffer("SELECT DISTINCT NEW com.reuters.tops.vo.view.RTEXViewVO");
brokerSummary.append("(ORG.organisationId , ORG.orgFullName ,");
//Taker Approved Organisations
brokerSummary.append(" (select count(*) from OrgApprovalVO as orgapproval,ApprovalVO as approval ");
brokerSummary.append(" where approval.requestId = orgapproval.requestId and ");
brokerSummary.append(" productdetails.queueOrganisationVO.organisationId = approval.apprOrgId and ");
brokerSummary.append(" orgapproval.statusId = 15 ))");
brokerSummary.append(" From QueueOrganisationVO as ORG,QueueProductDetailsVO as productdetails where ");
brokerSummary.append(" ORG.organisationId = productdetails.queueOrganisationVO.organisationId and ");
brokerSummary.append(" productdetails.queueOrganisationTypeVO.orgTypeId = 2 and ");
brokerSummary.append(" productdetails.productId = 1");
return getHibernateTemplate().find(brokerSummary.toString());


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.