On Aug 17, 2006, at 4:47 PM, Sacha Michel Mallais wrote:

On Aug 17, 2006, at 4:04 PM, Yann Bizeul wrote:

Say an entity MyEntity, having a many-to-many relationship with a Tag entity, the purpose of that is tagging MyEntity with one or more keywords (tags)

Now I want to get all MyEntity having "tag1" AND "tag2" as tags. An EOAndQualifier is nonsense in the result sql since if queries "tag1" = "tag1" AND "tag1" = "tag2", EOOrQualifier is not better since I need to match entries having *both* tags

Try "myAttribute CONTAINS %s AND myAttribute CONTAINS %s" for a format string, with params of "tag1" and "tag2", as in (warning, untested code):

EOQualifier q = EOQualifier.qualifierWithQualifierFormat ("myAttribute CONTAINS %s AND myAttribute CONTAINS %s", new NSArray (new Object[] {tag1, tag2}));

That _might_ work.

A safer bet is to use some extensions to WO. See Pierre Bernards excellent qualifier extensions at

http://www.bernard-web.com/pierre/webobjects/code.html

Doubtless in Project Wonder too, but Pierre's are more self contained.

Chuck

--

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 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