RE: Using 'match' in EOQualifier statement
RE: Using 'match' in EOQualifier statement
- Subject: RE: Using 'match' in EOQualifier statement
- From: "Scott, John R" <email@hidden>
- Date: Wed, 5 Mar 2003 15:28:14 -0000
- Thread-topic: Using 'match' in EOQualifier statement
Jonathan, Pierre and Ricardo,
Thanks for all your help. What Jonathan suggested worked fine. I should
have explained that I am using 4.5 as I am waiting delivery of 5.2.
John
-----Original Message-----
From: Jonathan Rochkind [mailto:email@hidden]
Sent: 04 March 2003 21:32
To: Pierre Bernard
Cc: Ricardo Strausz; Scott, John R; email@hidden
Subject: Re: Using 'match' in EOQualifier statement
Oops, I have to admit I haven't tried it recently myself. If it still
doesn't work this many versions later, it seems likely Apple doesn't
know
it doesn't work, and we ought to file a bug so they fix it. It is a
useful
(potential feature).
But WO/EOF were pretty much completley rewritten from scratch between
4.5
and 5.0, so it seems quite possible that it does work now. But I haven't
tried it.
At 09:01 PM 3/4/2003 +0100, Pierre Bernard wrote:
>Jonathan,
>
>did you actually get this to work. I remember trying this back with
>WebObjects 4.5. Though I did set the custom SQL in EOModeler I would
>assume this is equivalent to doing it in code. In my tests the custom
>query was always merrily ignored in favor of the standard qualifier.
>
>Pierre.
>
>On Tuesday, March 4, 2003, at 07:25 PM, Jonathan Rochkind wrote:
>
>>At 11:32 AM 3/4/2003 -0600, Ricardo Strausz wrote:
>>>Hi John,
>>>first of all, I'd never used the "match" with in a select (my Sybase
do
>>>not support it) so I think this most be a db-specific opt. If so, you
>>>may nead to use RawSQL to perform your fetch, but this means lot of
work
>>>(becouse after the fetch, you may want to 'see' such a >> data...
>>
>>You CAN use raw SQL with a normal fetch spec, resulting in actual EOs,
>>not raw rows. I don't know if that's the best solution here
either---it
>>has it's own problems. But it's a little known fact; many people think
if
>>you want to use raw SQL, you are limited to getting back raw rows, not
>>EOs. But instead: First consider this documentation as a disclaimer of
>>how you need to do this right:
>>
>>***
>>EODatabaseContext defines a hint for use with an EOFetchSpecification
>>(EOControl) in the method objectsWithFetchSpecification. Named by the
key
>>CustomQueryExpressionHintKey, the hint's value is an SQL string for
>>performing the fetch. The expression must query the same attributes in
>>the same order that Enterprise Objects Framework would if it were
>>generating the SELECT expression dynamically. If this key is supplied,
>>other characteristics of the EOFetchSpecification such as isDeep,
>>qualifier, and sortOrderings are ignored. In that sense, this key is
more
>>of a directive than a hint.
>>***
>>
>>You do it like this:
>>
>>String sqlQuery; //assume exists
>>EOFetchSpecifaction spec = new EOFetchSpecification("SomeEntity",
null,
>>null);
>>NSMutableDictionary dict = new NSMutableDictionary();
>>dict.setObjectForKey( sqlQuery,
>>EODatabaseContext.CustomQueryExpressionHintKey);
>>spec.setHints( dict );
>>
>>--Jonathan
>>
>>
>>
>>
>>>On the oder hand, you may have the same behave with standar SQL
>>>(supposing you have a good model) which then can be done via a std
>>>Qualifier and/or relations. Or, am I missing something?
>>>
>>>
>>>On martes, marz 4, 2003, at 07:30 America/Mexico_City, Scott, John R
wrote:
>>>
>>>>I am using a MySQL database and wish to create the equivalent of the
>>>>following SQL statement using an EOQualifier. Does anyone know if
this
>>>>is possible please?
>>>>
>>>>The SQL statement is of the form:
>>>>Select * from item where match (itemname,itemdescription) against
>>>>('adsl');
>>>>
>>>>Thanks
>>>>John
>>>>_______________________________________________
>>>>webobjects-dev mailing list | email@hidden
>>>>Help/Unsubscribe/Archives:
>>>>http://www.lists.apple.com/mailman/listinfo/webobjects-dev
>>>>Do not post admin requests to the list. They will be ignored.
>>>
>>>Dino
>>>http://homepage.mac.com/strausz
>>>_______________________________________________
>>>webobjects-dev mailing list | email@hidden
>>>Help/Unsubscribe/Archives:
>>>http://www.lists.apple.com/mailman/listinfo/webobjects-dev
>>>Do not post admin requests to the list. They will be ignored.
>>_______________________________________________
>>webobjects-dev mailing list | email@hidden
>>Help/Unsubscribe/Archives:
>>http://www.lists.apple.com/mailman/listinfo/webobjects-dev
>>Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.