Re: EOAndQualifier on child entity property
Re: EOAndQualifier on child entity property
- Subject: Re: EOAndQualifier on child entity property
- From: Sacha Michel Mallais <email@hidden>
- Date: Thu, 17 Aug 2006 16:47:07 -0700
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