You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Cris Daniluk <cr...@gmail.com> on 2006/06/08 03:08:52 UTC

Re: orExp resulting in *fewer* results

> Are there any plans or working notes on adding support to Cayenne for
> OUTER JOINs? I didn't find a CAY-xxx feature request.
>

Outer joins would be nice, though its complex because of the
differences in syntax... plus the whole issue that you are loading a
potentially incomplete object graph. For example, your join syntax and
qualifier could limit the toMany relationships arbitrarily, leaving
Cayenne to guess if it got the whole relationship or not. There are
already similar prefetch bugs to this, and they would have to be fixed
before OJ's could be tackled. But yeah... who doesn't want it :)

On the other hand, most developers abuse the outer join, creating
confusing queries that don't save as many CPU cycles as you would
really think. I think you might find that a regular prefetch could
handle your problem just as well. If you really need the performance
(or the special relationship fetching), use a SQLTemplate.

> Not for the faint of heart to add to Cayenne I take it.
>

Not really :)

Cris

Re: orExp resulting in *fewer* results

Posted by Øyvind Harboe <oy...@zylin.com>.
On 6/8/06, Cris Daniluk <cr...@gmail.com> wrote:
> > Are there any plans or working notes on adding support to Cayenne for
> > OUTER JOINs? I didn't find a CAY-xxx feature request.
> >
>
> Outer joins would be nice, though its complex because of the
> differences in syntax... plus the whole issue that you are loading a
> potentially incomplete object graph. For example, your join syntax and
> qualifier could limit the toMany relationships arbitrarily, leaving
> Cayenne to guess if it got the whole relationship or not. There are
> already similar prefetch bugs to this, and they would have to be fixed
> before OJ's could be tackled. But yeah... who doesn't want it :)
>
> On the other hand, most developers abuse the outer join, creating
> confusing queries that don't save as many CPU cycles as you would
> really think. I think you might find that a regular prefetch could
> handle your problem just as well. If you really need the performance
> (or the special relationship fetching), use a SQLTemplate.

The thing that cost us the most time was that Cayenne did not give an
error message, but happily created an INNER JOIN for an orExp().

Is this the intended behaviour of orExp()?

Personally I would have been happy if Cayenne threw an exception to
the effect "Can't create OUTER JOIN" or somesuch. It would have put me
on the right track immediately.

>
> > Not for the faint of heart to add to Cayenne I take it.
> >
>
> Not really :)
>
> Cris
>


-- 
Øyvind Harboe
http://www.zylin.com