Re: rawRowsForSQL and WORepetition
Re: rawRowsForSQL and WORepetition
- Subject: Re: rawRowsForSQL and WORepetition
- From: Arturo Perez <email@hidden>
- Date: Thu, 22 Apr 2004 15:17:31 -0400
Michael Engelhart wrote:
Hi -
I'm converting some JDBC/Servlet code over to WO for testing purposes
and have a question.
We can vanquish the Dark Overlord one hamlet at a time :-)
I need to use rawRowsForSQL (at least I think I do) for a query that
looks like this when viewed as a PreparedStatement in regular JDBC
code:
"SELECT code, name FROM countries WHERE code IN (SELECT DISTINCT
country FROM hotels) AND name LIKE ? ORDER BY name"
If this table is small enough and read-only enough it may be worth
putting into an application-level cache. (It's a checkbox in EOModel to
do so).
I know that rawRowsForSQL returns an NSArray of NSDictionary. What I
can't figure out is how to display this simple 2 column table.
I'm assuming that you used WOBuilder to create the table and that you
specified "Wrap second row in WORepetition". I further assume that your
repetition has the array as its list and the countryDictionary as its
item and that you've bound column1 to countryDictionary.name and column2
to countryDictionary.code or some such.
I can display it by connecting it to WOString's in each table cell but
can't seem to break it out using NSDictionary.objectForKey or something
like that.
What do you mean by break it out? Are you trying to get access to one
of the columns using objectForKey? You could try
countryDictionary.valueForKey("code") because that's what WO does.
-arturo
_______________________________________________
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.