Re: EOQualifier issue
Re: EOQualifier issue
- Subject: Re: EOQualifier issue
- From: "Daniele Corti" <email@hidden>
- Date: Tue, 21 Nov 2006 15:58:42 +0100
2006/11/21, Fabrice Pipart <email@hidden>:
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
fine, but I would prefer that you use the same name in the sql code ...
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 don't think so...
T0.ID = T1.PERSON_FID and
T0.ID = T2.PERSON_FID
are just a check for consistency, I mean the system must check that person are related with Employee and Employer. and it must be true with AND logic...
It's a bit hard to explane in english...
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 ???
I think your code should work too, it would be interesting to try it...
But, the meaning in this context is the same.
bye,
--
Daniele Corti
AIM: S0CR4TE5
Messenger:
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:
This email sent to email@hidden