How to construct an Hibernate HQL query containing a left join with a subquery in JBoss EAP 5?

Solution Verified - Updated -

Issue

  • How to translate the following sql query into hql?
SELECT customer.id , utility.data
FROM designation customer
LEFT JOIN
  (select tel.role_id, tel.data
   from role_DES des
   inner join RoleDES_use use on des.id=use.designation_id
   inner join code_value cv on use.use_cd=cv.id
   where cv.code='MC') utility
on (customer.id=utility.role_id )

Environment

  • JBoss Enterprise Application Platform (EAP) 4.3, 5.x
  • Hibernate 3.2.4 (Included in EAP 4)
  • Hibernate 3.3.2 (Included in EAP 5)

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.