| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
On Oct 25, 2007, at 8:59 PM, Lachlan Deck wrote:
On 26/10/2007, at 12:47 PM, Chuck Hill wrote:
On Oct 25, 2007, at 6:29 PM, Lachlan Deck wrote:
On 26/10/2007, at 10:40 AM, James Cicenia wrote:
I have a many-to-many relationship as such:
Portfolio --->>MetricGroups--->>MetricItems<----project_item---- >Project
How I can create a query where
project can have ( Items(a) OR Items(b) ) AND (Items(c))
Something like this...
NSMutableArray itemsAQuals = new NSMutableArray();
String keyPathToA = "blah.blah";
for ( Item a : itemsA ) {
itemsAQuals.addObject( new EOKeyValueQualifier( keyPathToA, EOQualifier.QualifierOperatorContains, a ) );
}
etc...
EOQualifier q = new EOAndQualifier( new NSArray( new Object[] { new EOOrQualifier(new NSArray(new Object[] { new EOAndQualifier( itemsAQuals ), new EOAndQualifier( itemsBQuals ) } ) ), new EOAndQualifier( itemsCQuals ) } ) );
That will work in memory, but EOQualifier.QualifierOperatorContains won't generate correct SQL for most databases.
News to me. Which databases do you think this affects? MySql is being used here...
Chuck
Do you use one that this works on?
I've seen problems when not using 'contains' when crossing toMany boundaries rather than the opposite. I could paste various usages of QualifierOperatorContains <here> but are you suggesting that it your experience it doesn't work at all for db fetches or just across more complex relational boundaries as above?
with regards, --
Lachlan Deck
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/chill% 40global-village.net
This email sent to email@hidden
--
_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/email@hidden
| References: | |
| >many-to-many query question (From: James Cicenia <email@hidden>) | |
| >Re: many-to-many query question (From: Lachlan Deck <email@hidden>) | |
| >Re: many-to-many query question (From: Chuck Hill <email@hidden>) | |
| >Re: many-to-many query question (From: Lachlan Deck <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.