Re: database views and webobojects
Re: database views and webobojects
- Subject: Re: database views and webobojects
- From: Chuck Hill <email@hidden>
- Date: Sun, 13 Jun 2010 22:02:44 -0700
On Jun 12, 2010, at 8:00 AM, Theodore Petrosky wrote:
> How would I do something like this in WO?
>
> two tables t_e_time, t_user
>
> I have been hacking on both the qualifier and sort to see where I could create the group by clause...
>
> this is what I want to accomplish...
>
> SELECT t1.c_user_id, sum(t1.c_amount_of_time), t2.c_first_name, t2.c_last_name
> FROM t_e_time t1
> JOIN t_user t2
> ON t1.c_user_id = t2.id GROUP BY t1.c_user_id, t2.c_first_name, t2.c_last_name;
>
> I found ERXGroupingFetchSpecification but I can not find an example and without that I am lost...
That seems to be a "work in progress". The results of a group by is data not EOs. EOF does not really handle this as it is focused on EOs. You could do this in-memory, but I guess
> I expect that eventually I should move this to a procedure on the database to speed it up.. but maybe this will do just fine...
That could work and then use EOUtilities.rawRowsForStoredProcedureNamed to get the results as an NSArray of dictionaries.
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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden