@count keypath in qualifier
@count keypath in qualifier
- Subject: @count keypath in qualifier
- From: Greg <email@hidden>
- Date: Wed, 3 Aug 2005 10:33:17 +1000
Hi,
I am trying to construct a qualifier that will count the items in a
relationship. I have sale.@count, but it is throwing an exception
when trying to parse the @ character. Is it possible to use this type
of kvc in a qualifier?
Any help is greatly appreciated.
Regards,
Greg
public static NSArray allClientsWhoHaventSignedUpWantingEmail
(EOEditingContext ec) {
EOSortOrdering lastName = EOSortOrdering.sortOrderingWithKey
("lastName", EOSortOrdering.CompareCaseInsensitiveAscending);
EOSortOrdering firstName = EOSortOrdering.sortOrderingWithKey
("firstName", EOSortOrdering.CompareCaseInsensitiveAscending);
NSMutableArray order = new NSMutableArray();
order.addObject(lastName);
order.addObject(firstName);
EOQualifier onlyWantingContact =
EOQualifier.qualifierWithQualifierFormat("wantsEmailContact = %@",
new NSArray(new Boolean(true)));
EOQualifier hasMoreThan1Sale =
EOQualifier.qualifierWithQualifierFormat("sales.@count > 1", null);
EOQualifier objs[] = { onlyWantingContact, hasMoreThan1Sale };
EOAndQualifier ands = new EOAndQualifier(new NSArray(objs));
EOFetchSpecification fetchSpec = new EOFetchSpecification
("Client", ands, order);
return ec.objectsWithFetchSpecification(fetchSpec);
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden