Re: FrontBasePlugIn & EOQualifier.QualifierOperatorContains
Re: FrontBasePlugIn & EOQualifier.QualifierOperatorContains
- Subject: Re: FrontBasePlugIn & EOQualifier.QualifierOperatorContains
- From: Chuck Hill <email@hidden>
- Date: Tue, 13 Sep 2011 10:04:01 -0700
Cail is correct about the original usage of this. The intention (or, well, implementation as there is no documentation regarding intention) was for this to be used with string arguments. Somewhere along the way (WO 5.2 maybe?) EOF was extended to interpret it differently for attributes and to-many relationships. I don't recall that it was ever mentioned in release notes or anything, it just starting working and people stopped complaining that it did not work. I was a nice enhancement.
Given that EOF now supports this, I think it is reasonable to remove that code from the FrontBase plugin so that it can also benefit.
Chuck
On 2011-09-13, at 5:45 AM, Cail Borrell wrote:
>
>
> Begin forwarded message:
>
>> From: Cail Borrell <email@hidden>
>> Date: 13. sep 2011 14.45.02 CEST
>> To: David Avendasora <email@hidden>
>> Cc: Cail Borrell <email@hidden>
>> Subject: Re: FrontBasePlugIn & EOQualifier.QualifierOperatorContains
>>
>> Hi David,
>>
>> I believe it was originally thought of as similar to the like qualifier and used with double truncated character predicates.
>>
>> As far as I can tell the actual meaning of the selector types are not specified.
>> If it is considered a bug or otherwise counter intuitive it would make sense to change
>> the behavior so it matches the general perception.
>>
>> At least for non character data types so nothing is broken. :-)
>>
>> However I have not made any changes to the frontbase plugin since it was submitted to wonder. But I could have a look at it.
>>
>> -Cail
>>
>>
>> On 13/09/2011, at 11.37, David Avendasora wrote:
>>
>>> I have a question about what the EOQualifier.QualifierOperatorContains is supposed to be for.
>>>
>>> I have always used it with Oracle and MSSQL Server as a way to create qualifiers that check to see if an Object is one of the objects in a toMany relationship. For example:
>>>
>>> EOQualifier thatHaveMeAsAFriend = Person.FRIENDS.containsObject(me);
>>> kevinBacon.friends(editingContext(), thatHaveMeAsAFriend, null);
>>>
>>> Which should generate a WHERE clause something like:
>>>
>>> WHERE T1.Person_ID = 1
>>>
>>> Only with FrontBase, the PlugIn overrides the handling of EOQualifier.QualifierOperatorContains and treats it as though you are searching for a substring, you know, what EOQualifier.QualifierOperatorLike already does.
>>>
>>> The SQL that it generates is:
>>>
>>> WHERE T1.Person_ID like 1
>>>
>>> Which FrontBase promptly, and correctly, chokes on.
>>>
>>> If I simply comment out the plugin's overriding of _FrontBasePlugIn#sqlStringForSelector(NSSelector, Object) then my qualifier works as expected.
>>>
>>> Oh, and just to make my case stronger, if you apply the above qualifier in-memory (take the DB out of the equation), it also works correctly.
>>>
>>> It appears that the code has been there at least since Oct. 2008.
>>>
>>> Is my interpretation of what the plugin should be doing incorrect? Are people out there using the EOQualifier.QualifierOperatorContains and expecting a "like" in their SQL's WHERE clause?
>>>
>>> Thanks!
>>>
>>> Dave
>>>
>>>
>>> _______________________________________________
>>> 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
>>
>
> _______________________________________________
> 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
--
Chuck Hill Senior Consultant / VP Development
Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
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