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.