-->
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: How to ue subqueries that return a multiple valies
PostPosted: Thu Apr 08, 2004 3:58 pm 
Beginner
Beginner

Joined: Tue Apr 06, 2004 6:13 pm
Posts: 39
Location: Pune, Maharashtra, INDIA
Hi,

I am using NamedQueries in my Hibernate object.

My Named query is like
Code:
   <query name="only.partners.who.sell.products">
       <![CDATA[
       from equicom.offline.partner.Partner as Partner WHERE Partner.id IN
       (SELECT DISTINCT PP.partner_id
       FROM PARTNER_PROD PP WHERE PP.channel_id=(SELECT CC.channel_id FROM CHANNEL_CODE CC WHERE CC.channel_cd = 'OFFLINE')) ORDER BY Partner.name
        ]]>
</query>


In other words in my Partner Hibernate class, I want only certain records filtered by the IN clause

And as you can see I am mixing HQL and SQL
(the tables referred in the WHERE part are not hibernated and I dont want too.)

Hibernate 2.1.2 does not support it

Any suggestions how I can achieve this?

I want to use Named Queries as that helps in externalizing my queries outside of java code.

_________________
thks
G1


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.