• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Qualifier with key path keywords
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Qualifier with key path keywords


  • Subject: Re: Qualifier with key path keywords
  • From: Anjo Krank <email@hidden>
  • Date: Tue, 26 Apr 2005 08:15:19 +0200


Am 26.04.2005 um 02:32 schrieb Chuck Hill:

Pierre Bernard has some very cool qualifier extensions on his site:
http://homepage.mac.com/i_love_my/code.html

As has Project Wonder with the ERXToManyQualifier which does pretty much what was requested:


If you want to find say departments that have 5 or more of the given employees (imagine you have a list of 10 or so), then you could construct the qualifier like:

ERXToManyQualifier q = new ERXToManyQualifier("toEmployees", employees, 5);

or to find any department that has at least one of the given employees

ERXToManyQualifier q = new ERXToManyQualifier("toEmployees", employees, 1);

Cheers, Anjo



You might find what you need there or at least a good starting point.


Chuck


On Apr 25, 2005, at 4:42 PM, Greg wrote:


Hi,
I am wanting to find all the clients that have made more than 1 purchase. I have the following qualifier:


public NSArray customersWhoHaveBoughtMoreThanOnce() {
EOQualifier sales = EOQualifier.qualifierWithQualifierFormat("sales.@count > 1", null);
EOSortOrdering lName = EOSortOrdering.sortOrderingWithKey("lastName", EOSortOrdering.CompareAscending);
EOSortOrdering fName = EOSortOrdering.sortOrderingWithKey("firstName", EOSortOrdering.CompareAscending);
Object args[] = {lName, fName};


EOFetchSpecification fetchSpec = new EOFetchSpecification("Client", sales, new NSArray(args));
return theSession().defaultEditingContext ().objectsWithFetchSpecification(fetchSpec);
}


It throws an exception saying that it is a problem parsing the '@'. If I remove the '@' symbol from the qualifier it too fails as there is no count found. I read through the EOQualifier javadoc but it didn't show any examples of building a qualifier with '@', but it too didn't say whether or not it is illegal to do it.

Is it possible to use the '@' symbol in a qualifier and I'm just using it incorrectly?
Is there a better way to achieve this?


Any help is greatly appreciated.

Regards,
Greg

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40global-village.net


This email sent to email@hidden


--
Practical WebObjects - a book for intermediate WebObjects developers who want to increase their overall knowledge of WebObjects, or those who are trying to solve specific application development problems.
http://www.global-village.net/products/practical_webobjects




_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40logicunited.com


This email sent to email@hidden



_______________________________________________
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


References: 
 >Qualifier with key path keywords (From: Greg <email@hidden>)
 >Re: Qualifier with key path keywords (From: Chuck Hill <email@hidden>)

  • Prev by Date: Debugging WO
  • Next by Date: Re: Debugging WO
  • Previous by thread: Re: Qualifier with key path keywords
  • Next by thread: Debugging WO
  • Index(es):
    • Date
    • Thread