cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hugi Thordarson <>
Subject Always using outer joins
Date Thu, 27 Aug 2015 15:37:18 GMT
Hi all.

I find that when I query over relationships I (and my users) almost always want an outer join.
For example, if I ask for a list of Employee objects based on the expression ((name=’McDonald’)
or (‘McDonald’)), I don’t want to exclude employees named “McDonald"
that don’t have an associated company record. The part of the query that involves the company
is separated from the first part by a logical “or” and thus the user will always believe
that it should not affect results of other parts of the expression. Checking for employees
without a company feels like a third condition that should be explicitly stated.

I know I can call “outer()” on a property every time I’m constructing paths to query
on, however, that gets old fast (and easy to forget), so currently I’m doing string replace
in my paths, replacing “.” with “+.”. That makes me feel dirty.

So, I ask: Is there any way for me to ask Cayenne to implicitly perform outer joins when filtering
on expressions, unless explicitly otherwise stated? For example, when modeling relationships?
(as is done in EOF)

- hugi

// Hugi Thordarson
// <>
// s. 895-6688

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message