Re: Creating complex qualifiers
Re: Creating complex qualifiers
- Subject: Re: Creating complex qualifiers
- From: Lachlan Deck <email@hidden>
- Date: Tue, 28 Oct 2008 08:41:23 +1100
Hi Catarina,
On 22/10/2008, at 3:27 AM, Catarina Simoes wrote:
In the project I'm working on I'm trying to refactor some old code
that uses
EOSQLQualifier.
I'd like to move on from EOSQLQualifier, not only because it's
deprecated
but the string arguments are quite a mess and error prone.
The sql statement generated by the fetch specification and the
EOSQLQualifier is something like:
(row1 + row2) / 100 >= value
The code to create the qualifier is:
String format = "(%A + %A) / 100 > = %@";
String args = new Object[] {entityProperty1, entityProperty2, value};
EOQualifier qualifier = new EOSQLQualifier(entity, format, args );
The variables entityProperty1 and entityProperty2 are entity
properties
(attributes or relationship key paths).
Basically I want to create complex qualifiers not restricted to single
attributes or relationships but involving arithmetic operations
between them.
Has anyone done something like this?
It may be that you'll need to create some custom EOQualifier
subclasses to achieve this.
Or have a look at ERXEOControlUtilities.aggregate* in Wonder.
Or http://code.google.com/p/houdah-webobjects-frameworks/wiki/QualifierAdditions
with regards,
--
Lachlan Deck
_______________________________________________
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