• 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
Re: EOQualifier issue
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EOQualifier issue


  • Subject: Re: EOQualifier issue
  • From: Fabrice Pipart <email@hidden>
  • Date: Wed, 22 Nov 2006 15:23:12 +0100
  • Resent-date: Thu, 23 Nov 2006 09:22:46 +0100
  • Resent-from: Fabrice Pipart <email@hidden>
  • Resent-message-id: <email@hidden>
  • Resent-to: WebObjects Dev Apple <email@hidden>


On Nov 22, 2006, at 10:49 AM, Alexander Spohr wrote:


Am 22.11.2006 um 09:39 schrieb Fabrice Pipart:

Is it me that asked for that in the Qualifier or that's a mistake of EOF ?

It's EOF’s mistake.
EOF makes sure that you get your persons. So it needs to join them with the employee and the employer tables. Therefore the AND. It has no notion that you wanted to different joins - and those connected by OR.

You are right. This is what you want:
(T1.COMPANY_FID = ? AND T0.ID = T1.PERSON_FID) OR (T2.COMPANY_FID = ? AND T0.ID = T2.PERSON_FID)
But EOF can not create that for you, as it tries to qualify one result set, that fits the given qualifier. You want two result-sets in one select statement.

Ah !
Good to hear !

I was wondering if I was mad or that bad in SQL ;-)


Solution: Do two fetches.

I can do that, now that I know there is no mistake on my side.
Something like : 

EOQualifier qual = new EOKeyValueQualifier("employer.company", EOQualifier.QualifierOperatorEqual, playlist);
        EOSortOrdering nameOrdering = EOSortOrdering.sortOrderingWithKey("name", EOSortOrdering.CompareAscending);
        NSMutableArray ordering = new NSMutableArray();
        ordering.addObject(nameOrdering);
        EOFetchSpecification fs = new EOFetchSpecification("Media", qual, ordering, true, false, null);
        NSArray mediaList = ec.objectsWithFetchSpecification(fs);

EOQualifier qual = new EOKeyValueQualifier("employee.company", EOQualifier.QualifierOperatorEqual, playlist);
        EOSortOrdering nameOrdering = EOSortOrdering.sortOrderingWithKey("name", EOSortOrdering.CompareAscending);
        NSMutableArray ordering = new NSMutableArray();
        ordering.addObject(nameOrdering);
        EOFetchSpecification fs = new EOFetchSpecification("Person", qual, ordering, true, false, null);
        NSArray mediaList = ec.objectsWithFetchSpecification(fs);



And use EOKeyValueQualifier and EOOrQualifier, thats cleaner and faster.

.... what do you mean there ?
Ok I can create EOOrQualifier filter = new EOOrQualifier(new NSArray(new Object[] { employerFilter, employeeFilter }));
But then, how can that help me ?
I suppose you're talking about in memory operations but I can't see how to do this...
Please note that I need distincts objects because some will be common between the two fetches

I am absolutely sorry if the question is stupid :-(


Fabrice



good luck,
atze


Freeport & Soliversum
Alexander Spohr
email@hidden
www.freeport.de





www.easyshadow.com

International Corporate Consulting
Palais de la Scala
1 avenue Henri Dunant
Suite 1155
MC - 98000 Monaco

Skype: fabrice.pipart
Tel.  +377 97 98 21 04 (direct)
Fax. +377 97 70 88 07


 _______________________________________________
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: EOQualifier issue
      • From: "Daniele Corti" <email@hidden>
  • Prev by Date: Oracle and NVARCHAR2 with WO/EOF?
  • Next by Date: Re: EOQualifier issue
  • Previous by thread: Re: EOQualifier issue
  • Next by thread: Re: EOQualifier issue
  • Index(es):
    • Date
    • Thread