Hi Wouter,
This seems like the problem discussed on the users_at_glassfish thread to
which I replied today:
https://glassfish.dev.java.net/servlets/ReadMsg?list=users&msgNo=1452
Does it make sense? OneToMany side of the relationship defaults to
the fetch type LAZY.
thanks,
-marina
P.S. For those of you who are interested in the previous emails on this
subject see
https://glassfish.dev.java.net/servlets/BrowseList?list=ejb&by=thread&from=584689
Mahesh.Kannan wrote:
> Hi Wouter,
> I have forwarded this to the Corba team. CCing persistence team also
> on this thread.
>
> --Mahesh
>
> Wouter van Reeven wrote:
>
>> On Fri, Nov 17, 2006 at 03:18:52PM +0100, To
>> ejb_at_glassfish.dev.java.net wrote:
>>
>>
>>> OK when I only comment out the cultiUserCollection member etc in the
>>> CultiUserRole class but leave the userroleId member etc in CultiUser
>>> uncommented, everything still works. This is lucky, since I am only
>>> interested
>>> in what roles a user has, and not in what users have a certain role.
>>> It is still
>>> intriguing, however, why the cultiUserCollection mapping gives an error.
>>>
>>
>>
>> And when I add "fetch=FetchType.EAGER" to the cultiUserCollection
>> annotation
>> like this
>>
>> @OneToMany(mappedBy = "userroleId", fetch=FetchType.EAGER)
>> private Collection<CultiUser> cultiUserCollection;
>>
>> everyting works fine. I assumed that the fetch type would only matter
>> when the
>> actual CultiUser was needed, but apparently it matters already when
>> fetching.
>>
>>
>> Thanks, Wouter
>>
>>
>>