Re: Using 'match' in EOQualifier statement
Re: Using 'match' in EOQualifier statement
- Subject: Re: Using 'match' in EOQualifier statement
- From: Jonathan Rochkind <email@hidden>
- Date: Tue, 04 Mar 2003 12:25:00 -0600
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.