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

Mattias Jiderhamn (JIRA) noreply at atlassian.com
Tue Sep 5 03:42:24 EDT 2006


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2049?page=comments#action_24306 ] 

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

I don't think you studied the test case properly.

Assume parents P1 and P2. P1 has child A and B. P2 has child B.
Creating a criteria looking for all parents with child A correctly returns P1 *but* the child collection of P1 (p1.getChildren()) will only contain A, even if B is also a child of P1. (Looking up P1 with it's primary key will properly return a parent with both A and B as children)

So the filter is not on the entities queried. The entities returned by the query is correct. But the child collections of those entities are erroneously initilized!

> LEFT OUTER JOIN subcriteria filters children
> --------------------------------------------
>
>          Key: HHH-2049
>          URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2049
>      Project: Hibernate3
>         Type: Bug

>   Components: query-criteria
>     Versions: 3.1.3, 3.2.0.cr4
>  Environment: Hibernate 3.1.3/3.2.0rc4, hsqldb 1.8
>     Reporter: Mattias Jiderhamn
>  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