You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by "Hardy, Derek" <De...@astrazeneca.com> on 2003/07/24 11:25:12 UTC
[beanUtils] ResultSetDynaClass and DynaValidatorForm
Hi
Is it possible to transfer the contents of a ResultSetDynaClass into a
DynaValidatorForm, in a similar way to transferring the ResultSet into an
ArrayList of DynaBeans that uses the following standard code?
ResultSetDynaClass rsdc = ...;
DynaProperty properties[] = rsdc.getDynaProperties();
BasicDynaClass bdc = new BasicDynaClass("foo", BasicDynaBean.class,
rsdc.getDynaProperties());
Iterator rows = rsdc.iterator();
while (rows.hasNext()) {
DynaBean oldRow = (DynaBean) rows.next();
DynaBean newRow = bdc.newInstance();
PropertyUtils.copyProperties(newRow, oldRow);
results.add(newRow);
}
Thanks
Derek