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 protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to