Hello Ted,

Saturday, June 09, 2001, 12:55:04 AM, you wrote:

TH> Just as an aside, Oleg:

TH> When I use RowSets as value object beans, the type is determined by the
TH> JDBC metadata. I've been putting some wrappers around that so the
TH> properties have ordinary getters and setters. 

TH> I see that BeanFactory includes code to create tables, but what about
TH> reading tables to create beans?

Some confusion... There are SQL scripts to create sample database -
are you talk about it? If yes then my answer is below.

Each factory must implement create method to generate bean.
There are abstract class org.apache.struts.factory.jdbc.JDBCFactory -
base class for all jdbc related factories. Its create method uses
first parameter from bean template as SQL query to create
PreparedStatement and call method processResult( ResultSet...). This
method is abstract and every derived class must implement it and
JDBCArrayFactory, for example, walk throw result set and for each row
create bean of target type and call populateFrom( ResultSet ) for
every bean - this method do all work to fill new bean with values from
current row.

-- 
Best regards,
 Oleg                            mailto:[EMAIL PROTECTED]


Reply via email to