Re: EOAndQualifier on child entity property
Re: EOAndQualifier on child entity property
- Subject: Re: EOAndQualifier on child entity property
- From: Yann Bizeul <email@hidden>
- Date: Fri, 18 Aug 2006 21:15:55 +0200
EOQualifier q = EOQualifier.qualifierWithQualifierFormat
("myAttribute CONTAINS %s AND myAttribute CONTAINS %s", new NSArray
(new Object[] {tag1, tag2}));
If this is equivalent to using a EOAndQualifier to join two
"CONTAINS" statements, then yes, I did try and it gives the same result
Thanks :-)
Yann Bizeul • yann at tynsoe.org
Cocoa Developer
Le 18 août 06 à 01:47, Sacha Michel Mallais a écrit :
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}));
sacha
--
Sacha Michel Mallais Senior Developer / President
Global Village Consulting Inc. http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
So it doesn't mess up the flow of reading.
> How come?
> > I prefer to reply inline.
> > > What do you do instead?
> > > > No.
> > > > > Do you like top-posting?
_______________________________________________
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