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 (employee.company.name=‘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)

Cheers,
- hugi

// Hugi Thordarson
// http://www.loftfar.is/ <http://www.loftfar.is/>
// s. 895-6688



Reply via email to