[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-2049) LEFT OUTER JOIN subcriteria filters children (Mattias Jiderhamn)

Mattias Jiderhamn (JIRA) noreply at atlassian.com
Tue Jun 7 10:28:26 EDT 2011


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

Mattias Jiderhamn commented on HHH-2049:
----------------------------------------

Many thanks for the effort Gail!

This resolves the issue in the simple case - however it does not solve our real world problem. It seems that this fix does not handle the case when there are multiple levels of left joins, and any of them don't have any restrictions. Then it will break (i.e. start filtering non-matching children) on that level.

In code:
  parentCriteria.createCriteria("firstLevelChildren", JoinFragment.LEFT_OUTER_JOIN).createCriteria("secondLevelChildren", JoinFragment.LEFT_OUTER_JOIN).add(...);
will still filter the first level children with only those having second level children that matches the criteria. However if a condition is added on the first level also, it works.

Do you see a solution for this...?



> LEFT OUTER JOIN subcriteria filters children (Mattias Jiderhamn)
> ----------------------------------------------------------------
>
>                 Key: HHH-2049
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2049
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: query-criteria
>    Affects Versions: 3.1.3, 3.2.0.cr4, 3.5.0.Beta-1, 3.5.2, 3.6.3
>         Environment: Hibernate 3.1.3/3.2.0rc4, hsqldb 1.8
>            Reporter: Mattias Jiderhamn
>            Assignee: Gail Badner
>             Fix For: 3.6.4, 4.0.0.Alpha3
>
>         Attachments: SubCriteriaTestCase.zip
>
>
> When using the Criteria API with LEFT OUTER JOIN to add criterias to the children, i.e.
>   criteria.createCriteria("children", JoinFragment.LEFT_OUTER_JOIN)
> the child collections will only contain those children matching the criteria. (Even when *not* using any Filters).
> The attached testcase (also found here: http://forum.hibernate.org/viewtopic.php?p=2320786) will explain it in more detail.

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