Re: Fetch Specifications on class method results
Re: Fetch Specifications on class method results
- Subject: Re: Fetch Specifications on class method results
- From: Giorgio Valoti <email@hidden>
- Date: Tue, 7 Oct 2003 09:10:17 +0200
On Martedl, ott 7, 2003, at 03:58 Europe/Rome, Ray Ackland wrote:
Can anyone tell me if you can do display group (or otherwise) fetches
that use a calculated Boolean value? The particular case I am
interested in is to create a list of clients whose DOB is invalid. I
have a method in the class file called ageNow(), and would like to use
that to filter the records where ageNow()<0 or ageNow>100 (say).
Currently I am using a display group with a WOConditional using
another method (isDobValid()) returning a bool value based on
ageNow(). The result of this is the produced web page will have
varying numbers of clients showing (perhaps even none).
I expect any fetch spec will be converted to SQL on the original DB,
which doesn't have this derived information. I guess I can set up the
fetch to compare dates in the DB to today's date, but (out of
interest) would like to know if there is another way.
You cannot use a method on your custom EO on fetch spec's qualifier,
since there's no way for EOF to construct the corresponding SQL. So,
yes, you should create a fetch that directly compares dates.
HTH
--
Giorgio Valoti
-------------
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.