[hibernate-issues] [Hibernate-JIRA] Created: (HHH-6593) Fetch joining subelements of a one-to-one or many-to-one association

Christian Beikov (JIRA) noreply at atlassian.com
Sun Aug 21 19:50:05 EDT 2011


Fetch joining subelements of a one-to-one or many-to-one association
--------------------------------------------------------------------

                 Key: HHH-6593
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6593
             Project: Hibernate Core
          Issue Type: Bug
    Affects Versions: 3.6.6
            Reporter: Christian Beikov
            Priority: Critical


The problem is discussed on the forum a long time ago. I just found the topic and i wanted to report that this bug is still available in 3.6.6
https://forum.hibernate.org/viewtopic.php?f=1&t=987905&start=0

Here a concrete example from my usecase:

class A{
 private B b;
}

class B{
 private Map<String, C> map;
}

class C{
 private String c;
}

Just imagine that the classes and fields would be annotated right ;)
Now the problem in my case was that i wanted a list of A elements with fetch joined B and of course it's map.
I tried the following query:

FROM A a LEFT OUTER JOIN FETCH a.b bElem LEFT OUTER JOIN bElem.map cMap

and i got a NullPointerException just like the users which posted in the given topic.

My workaround was:

FROM A a LEFT OUTER JOIN FETCH a.b bElem LEFT OUTER JOIN a.b.map cMap

The main problem now is, that i have a dynamic fetch profile system which won't work correctly if this issue is not solved.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list