[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-3538) Criteria.createAlias/Criteria.createCriteria forces join fetching of association

Shawn Clowater (JIRA) noreply at atlassian.com
Wed Sep 23 12:18:50 EDT 2009


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

Shawn Clowater commented on HHH-3538:
-------------------------------------

This also occurs where using the createAlias methods.  It will also throw off any paging you're doing, i.e. since the joined tables are being fetched upfront if you have any sort of max results set on the criteria you're going to end up with a reduced number of what you're actually looking for.

Work around is to use explicit subqueries instead of inner joins.

> Criteria.createAlias/Criteria.createCriteria forces join fetching of association
> --------------------------------------------------------------------------------
>
>                 Key: HHH-3538
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3538
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: query-criteria
>    Affects Versions: 3.2.6, 3.3.1
>            Reporter: Hauke Rabe
>            Assignee: Steve Ebersole
>             Fix For: 3.2.x, 3.3.x, 3.5
>
>         Attachments: hhh-3538.zip, hhh-3538b.zip
>
>
> The underlying cause is an invalid assumption made in JoinWalker that every association found in its association member list is to be fetched (added to the select fragment).  

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