cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hugi Thordarson <h...@karlmenn.is>
Subject Re: Always using outer joins
Date Fri, 28 Aug 2015 07:15:56 GMT
Okay, thanks!

- hugi



> On 28. ágú. 2015, at 06:44, Andrus Adamchik <andrus@objectstyle.org> wrote:
> 
> No, that's a decision you'd make when building an expression (like you do).
> 
> We actually initially thought of adding join semantics to relationships in the model,
but that felt misplaced, so it ended up where it is now.
> 
> Andrus
> 
> 
>> On Aug 27, 2015, at 6:37 PM, Hugi Thordarson <hugi@karlmenn.is> wrote:
>> 
>> 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
>> 
>> 
>> 
> 


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