users@glassfish.java.net

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

From: <glassfish_at_javadesktop.org>
Date: Thu, 08 Feb 2007 12:06:26 PST

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