Hi,
Geoffrey Wiseman wrote:
> Question:
> How the heck do I make an EOQualifier across a relationship? I'll use the
> example I'm working with, simplified: I have a table of rates that can be
> applied to particular companies at particular dates. I want to filter the
> display group based on the company. Reasonable enough, right? So I begin
> to make an EOQualifier. But then it occurs to me that I have no idea how to
> actually go about it in this case, since I want to filter it based on a
> relationship.
>
> [munch]
>
> So, let's say, for the sake of having terms to work with, I have a Rates
> table/object with a toCompany relationship defined based on the
> non-class-property "companyID" and a Companies table whose primary key is
> companyID. I have a display group called dgRates which is connected to the
> rates table, and I want to qualify it based on a the users's company, which
> is known coming into the page. Where do I go from here?
This should be pretty easy:
qualifier = [EOQualifier qualifierWithQualifierFormat: @"toCompany.name = 'XXX']
The fact that your PK and FK are not class properties is not really a problem.
In fact we sometimes add additional relationships (e.g. bidirectional or
otherwise expensive to compute) as non class properties. This allows you to use
them in qualifiers without generating them in memory.
dk
--
David Koski
Running Start, Inc.
[EMAIL PROTECTED]
http://www.running-start.com