• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: EOAndQualifier on child entity property
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EOAndQualifier on child entity property


  • Subject: Re: EOAndQualifier on child entity property
  • From: Chuck Hill <email@hidden>
  • Date: Thu, 17 Aug 2006 16:51:42 -0700


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@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: EOAndQualifier on child entity property
      • From: Yann Bizeul <email@hidden>
    • Re: Re: EOAndQualifier on child entity property
      • From: "John Huss" <email@hidden>
References: 
 >EOAndQualifier on child entity property (From: Yann Bizeul <email@hidden>)
 >Re: EOAndQualifier on child entity property (From: Sacha Michel Mallais <email@hidden>)

  • Prev by Date: Re: No announcement yet?
  • Next by Date: Re: Open source as the way some important software is developed
  • Previous by thread: Re: EOAndQualifier on child entity property
  • Next by thread: Re: Re: EOAndQualifier on child entity property
  • Index(es):
    • Date
    • Thread