[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-3356) Support for subselect (subquery) in from clause

Arbi Sookazian (JIRA) noreply at atlassian.com
Tue Apr 21 17:51:17 EDT 2009


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-3356?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=32966#action_32966 ] 

Arbi Sookazian commented on HHH-3356:
-------------------------------------

I am unable to run the following HQL query as well due to the same reason (sub-select in from clause):

SELECT	LVH.dropDownValueHierarchyId
	FROM DropDown LV2
	LEFT OUTER JOIN
			(
			SELECT 
			tLVH.dropDownByDropDownId.dropDownId, tLVH.dropDownValueCode, tLVH.parentDropDownValueCode				
			FROM ListValueHierarchy tLVH
				INNER JOIN ListValue tLV ON  tLVH.dropDownByDropDownId.listId = tLV.dropDown.dropDownId And tLVH.dropDownValueCode = tLV.code
			WHERE tLV.dropDownValueId = 5
			) LVH ON LV2.Code = LVH.parentDropDownValueCode 
	WHERE LV2.dropDownId = 5

what is the recommendation for this scenario?  simply use native query?  or is there an alternative way to write the HQL query?

> Support for subselect (subquery) in from clause
> -----------------------------------------------
>
>                 Key: HHH-3356
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3356
>             Project: Hibernate Core
>          Issue Type: New Feature
>          Components: query-hql
>            Reporter: Geoffrey De Smet
>
> Many databases support subselects in the from clause, for example:
>   http://dev.mysql.com/doc/refman/5.0/en/unnamed-views.html
> And it's very handy.
> Native query's are sometimes a working workaround, but have many disadvantages, unlike HQL.
> Btw, I've searched through jira for over 20 minutes and didn't find an issue for this already. If there is one already, please give it a better title or link it to this issue :)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list