Well, he's looking for all clients that have open jobs. In that case, you would create a fetch specification for Client where jobs.status = 'open'. Then make sure to do call setUsesDistinct with true on the fetch specification.

A view is basically just a canned query - you can get the same results, and similar speed, by doing the proper join inside WebObjects via qualifiers.

Ken


On Feb 10, 2009, at 6:16 PM, Chuck Hill wrote:


On Feb 10, 2009, at 2:33 PM, Theodore Petrosky wrote:


I have two tables.

jobs and clients

clients have many jobs but a job has only one client.

I need to generate a list of clients that have open jobs. If I were doing this 'normally' I would create a View on the table such that it was a listing of clients with open jobs. Then I could query this view for the list of clients. works really fast.

how can I accomplish the same thing in webobjects? Is there a way to create this view using migrations?


If you are thinking about the database, you are using WebObjects incorrectly. Just fetch jobs where client = client and status = 'open'


Chuck

--
Chuck Hill             Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific 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      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/kenlists%40anderhome.com

This email sent to kenli...@anderhome.com

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to