users@glassfish.java.net

Re: _at_ManyToMany = inner join but I want outer left join (i.e. optional = true)

From: Gordon Yorke <gordon.yorke_at_oracle.com>
Date: Thu, 15 Feb 2007 08:49:41 -0500

Hello, This may be caused by mapping the relationship as eager you may
wish to use lazy as a workaround. Although as I am not a hibernate
expert this is just a guess. You may want to try TopLink Essential
(the default persistence provider in glassfish). TopLink will not
perform an inner-join here unless specifically asked to do so in your
query.
 -Gordon

glassfish_at_javadesktop.org wrote:
> Hello,
>
> I have a @ManyToMany relationship declared in a class (class A) that maps to another class (class B). I notice that when I create HSQL to retrieve instances of class A for which there are no class B's available, due to the generated inner join, no class As will be returned if they don't have at least one class B associated with them. I would like class As to be returned whether or not they have any class Bs associated with them (i.e. a left outer join not an inner join in the generated SQL).
>
> Given that @ManyToMany does not offer an optional setting, does anyone know how I might do this?
>
> Thanks,
>
> Matthew
> [Message sent by forum member 'javanetuser_4418' (javanetuser_4418)]
>
> http://forums.java.net/jive/thread.jspa?messageID=202705
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>