> On Mar 25, 2016, at 7:45 PM, Hugi Thordarson <h...@karlmenn.is> wrote:
> 
> Hi all!
> 
> Subject says it all, really. How do I write an Expression to fetch all 
> records where a to-many relationship contains an object.
> 
> For example, let’s say a “Person” entity has a to-many relationship to an 
> “Employment" entity, which is then linked to a “Company” entity. And I want 
> to fetch all “Person” records that are linked to a certain company record.\

Something like "employments.company = $company" should work. This results in 
simple joins across to-many, and should give you what you need.

Andrus

Reply via email to