[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-1718) Have multiple bag fetches revert to subselect fetching for all but one of the bags

Steve Neal (JIRA) noreply at atlassian.com
Wed Oct 8 11:06:08 EDT 2008


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

Steve Neal commented on HHH-1718:
---------------------------------

There's a simple, although non-JPA-standard, fix for this.

Specify the following Hibernate annotation alongside your OneToMany field. like so:

    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
    @Fetch(value = FetchMode.SUBSELECT)
    private List<Child> children = new ArrayList<Child>();

Then hibernate will use a subselect rather than a join which is the cause of the issue!


> Have multiple bag fetches revert to subselect fetching for all but one of the bags
> ----------------------------------------------------------------------------------
>
>                 Key: HHH-1718
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1718
>             Project: Hibernate Core
>          Issue Type: Improvement
>          Components: core, query-criteria, query-hql
>            Reporter: Steve Ebersole
>            Assignee: Steve Ebersole
>             Fix For: hql+collection
>
>         Attachments: hibernate_eksempel.zip
>
>
> Follow on to HHH-1413.  Multiple bag fetches were simply disallowed as the resolution to that particular case in the interest of working around that issue.
> The correct longer term solution is to not fetch all the bags at once, ideally reverting to subselect fetching for all but one of the bags.

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