Re: Qualifiers LIKE problem
Re: Qualifiers LIKE problem
- Subject: Re: Qualifiers LIKE problem
- From: Sacha Mallais <email@hidden>
- Date: Thu, 7 Apr 2005 18:33:01 -0700
On Apr 7, 2005, at 6:02 pm, Greg wrote:
If you do %@*, causing it to throw an exception when parsing. Why
can't you put the wildcard in the string?
Greg:
%@ in a qualifier isn't quite like %s in a format string (in fact, %s
in a qualifier isn't quite like %s in a format string either...). It's
supposed to work for _any_ object, so for example, if I had Order and
OrderItems, I could construct a qualifier for OrderItems with this:
EOQualifier.qualifierWithQualifierFormat("order = %@", new
NSArray(myOrder));
This would return all OrderItems with the order attribute (i.e.,
relationship) equal to myOrder. This is represented in SQL as an inner
join on the global ID (i.e., primary key) of myOrder.
%@ also, as you've recently discovered, quotes strings properly. It
also handles different types of numbers properly. It's very powerful.
In fact, I very rarely use anything -other- than %@...
Cheers,
sacha
--
Sacha Michel Mallais - 800 lb. gorilla
Global Village Consulting Inc.: http://www.global-village.net/
Bottom posting is your friend:
http://www.river.com/users/share/etiquette/
_______________________________________________
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