-->
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: Error query hql
PostPosted: Fri Oct 22, 2010 3:36 am 
Newbie

Joined: Fri Oct 22, 2010 3:28 am
Posts: 6
I am doing a query with hql and i do not achieve that it works. it flaw join and coalesce. if I do the query without join, it me does not work coalesce.

@NamedQuery(name = "Stock.findByClientAndReference", query = "select distinct NEW com.fcclogistica.services.legacy.sga.entities.Stock(s.id, (select r.description from Reference r where r.id = s.id), s.situation, s.status, (select sum(ss.amount) - coalesce ((select sum(al.amount) from StockCapture al where al.id = s.id ), 0 ) - coalesce ((select sum(li.amount) from LineDeliveryNote li JOIN HeadDeliveryNote ca on ca.id = al.id and ca.deliveryNote = al.deliveryNote where li.id = s.id and ca.situation=''), 0 ) from Stock ss where ss.id = s.id and situation = '' group by ss.id)) from Stock s where s.id.client=? and s.id.code=? and situation = '' and status = 'B' order by s.id")})

which can be the problem?

Thank You


Top
 Profile  
 
 Post subject: Re: Error query hql
PostPosted: Wed Oct 27, 2010 3:14 am 
Newbie

Joined: Fri Oct 22, 2010 3:28 am
Posts: 6
it is not possible to use select in coalesce????

Helps, please


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.