The standard way:

EOQualifier lowerQual = new EOKeyValueQualifier("articleDate", EOQualifier.QualifierOperatorGreaterThanOrEqualTo, startDate); EOQualifier upperQual = new EOKeyValueQualifier("articleDate", EOQualifier.QualifierOperatorLessThanOrEqualTo, endDate); NSMutableArray<EOQualifier> qualifiers = new NSMutableArray<EOQualifier>();
qualifiers.addObject(lowerQual);
qualifiers.addObject(upperQual);
EOQualifier qualifier = new EOAndQualifier(qualifiers);

The Wonder way:

EOQualifier qual = Article.ARTICLE_DATE.between(startDate, endDate);

This of course requires that you are using project Wonder and it's EOGenerator templates.

They rock.

This is a pretty good example of the kinds of things Wonder will do for you.

1/6th the code, and it is MUCH more readable.


Dave



On Jan 23, 2009, at 2:41 PM, Amedeo Mantica wrote:

Hello,

does anyone know hot to build a quelifier for looking up an item in a Date range?

I have a table of Articles, and I need to select a range by articleDate

I tried but I was unable to build a working qualifier

Regards
Amedeo
_______________________________________________
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/webobjects%40avendasora.com

This email sent to webobje...@avendasora.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