[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-530) Allow application of filters on subqueries

Shawn Clowater (JIRA) noreply at atlassian.com
Wed Sep 17 17:58:08 EDT 2008


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

Shawn Clowater commented on HHH-530:
------------------------------------

What's HQL? ;)

Bleh, I actually thought it was working on the HQL already (we are primarily Criteria).  From my initial pass trying to see what is disabling them in HQL it would appear that it might only be the following that would need to change....

In JoinProcessor there's a snippet 

{code}
// Generate FROM and WHERE fragments for the from element.
		JoinFragment joinFragment = join.toJoinFragment(
				inSubquery ? Collections.EMPTY_MAP : queryTranslatorImpl.getEnabledFilters(),
				fromElement.useFromFragment() || fromElement.isDereferencedBySuperclassOrSubclassProperty(),
				fromElement.getWithClauseFragment(),
				fromElement.getWithClauseJoinAlias()
		);
{code}
 
{code}
Which i think should just be 
// Generate FROM and WHERE fragments for the from element.
		JoinFragment joinFragment = join.toJoinFragment(
				queryTranslatorImpl.getEnabledFilters(),
				fromElement.useFromFragment() || fromElement.isDereferencedBySuperclassOrSubclassProperty(),
				fromElement.getWithClauseFragment(),
				fromElement.getWithClauseJoinAlias()
		);
{code}

Of course if it works then the whole inSubquery thing should be peeled back.

The only other suspect code I see would be in the token(String token, QueryTranslatorImpl q) method of WhereParser but it might be fine (aka I'm not sure exactly what it's doing)

> Allow application of filters on subqueries
> ------------------------------------------
>
>                 Key: HHH-530
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-530
>             Project: Hibernate Core
>          Issue Type: Patch
>          Components: core
>            Reporter: Gavin King
>            Assignee: Steve Ebersole
>             Fix For: 3.3.x
>
>         Attachments: HHH-530.3.3.SP1.patch, HHH-530.Additional.Subquery.patch, HHH-530.patch, hibernate_filter_fix-3.0.5.patch, hibernate_filter_fix-3.0.5_14.patch, SubqueriesWithFiltersTest.patch
>
>
> Currently filter conditions are applied in subselects, they should not be.

-- 
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