Hi all !
I have been suprised by the behavior of the EOQualifier and I wonder if it's a bug or just a misunderstanding on my part. Let's take a simple example (mine was far too complicated to show here) :
Let's say we have the following EO relationships : Person <--> Employer <--> Company Person <--> Employee <--> Company
Let's suppose I want to fetch the PERSONs that are employers and employees in a given company Naturally I had a qualifier like this one :
(employee.company = %@) OR (employer.company = %@)
I had troubles with this and then I activated the EOAdaptorDebug From what I found there, EOF generates the following : SELECT ... FROM PERSON T0, EMPLOYEE T1, EMPLOYER T2, COMPANY T3 WHERE (T1.COMPANY_FID = ? OR T2.COMPANY_FID = ?) AND T0.ID = T1.PERSON_FID AND T0.ID = T2.PERSON_FID
What is between brackets makes sense obviously and then EOF adds after ANDs all that is necessary to make the relationships right? But in that case I am looking for someone that is an employer AND an employee ??? I would have prefered to see : WHERE (T1.COMPANY_FID = ? AND T0.ID = T1.PERSON_FID) OR (T2.COMPANY_FID = ? AND T0.ID = T2.PERSON_FID)
Do I make a mistake ???
Regards
Fabrice
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
|