Efficient qualifier for to-many relationships?
Efficient qualifier for to-many relationships?
- Subject: Efficient qualifier for to-many relationships?
- From: Ondra Cada <email@hidden>
- Date: Fri, 17 Feb 2006 23:05:37 +0100
Hello,
this, I am afraid, is kind of EOF 101; still I haven't been able to
find the answer on wodeveloper... thus, please, forgive the following
question.
I need an efficient qualifier to fetch all objects from entity A,
whose to-many relationship to another entity is non-empty (i.e.,
there is at least one object in the relationship). A programming
solution like
NSMutableArray *ma=[NSMutableArray array];
for (id o,en=[[editingContext objectsForEntityNamed:@"A"]
objectEnumerator];o=[en nextObject];)
if ([[o theRelationship] count]>0) [ma addObject:o];
is, with the number of objects, out of question for it is too
inefficient.
Although from easthetical reasons I would like to use as high API
level as possible, in worst, in this project it might be an
EOSQLQualifier and the SQL might be MS-SQL-tailored, or even
rawRowsWithSQL:modelNamed:. Alas, I am no SQL guru, and don't know
how to create appropriate SQL expression.
Since the project is WO4.5-based, the ERXToManyQualifier of Project
Wonder does not really help (unless I get all the sources and turn
them to Objective-C myself).
Grateful for any help,
---
Ondra Čada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc
_______________________________________________
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