ejb@glassfish.java.net

Re: Trying to connect to Remote ession Bean from JSF backing bean

From: Wouter van Reeven <wouter_at_van.reeven.nl>
Date: Fri, 17 Nov 2006 15:41:56 +0100

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

-- 
People: "If she weighs the same as a Duck, she's made of wood!"
Sir Bedevere: "And therefore...?"