• 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
Efficient qualifier for to-many relationships?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: Efficient qualifier for to-many relationships?
      • From: Ken Anderson <email@hidden>
  • Prev by Date: Re: Help with: org.apache.xmlrpc.XmlRpcException: out of threads
  • Next by Date: Re: Help with: org.apache.xmlrpc.XmlRpcException: out of threads
  • Previous by thread: Re: Sorting objects using my own criteria
  • Next by thread: Re: Efficient qualifier for to-many relationships?
  • Index(es):
    • Date
    • Thread