On 6/8/06, Cris Daniluk <[EMAIL PROTECTED]> 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