--- Jorge Morales Pou <[EMAIL PROTECTED]> wrote: > Hi David, > From the reply I had from you, I dived into the latest snapshot code > and tried > to get the picture of what you said. > As you say I would only have to do: > > List mylist = (List) > run.query((String)queries.get(IQueries.ALL_EVENTS), > new BeanListHandler(Evento.class, new > BasicRowProcessor( new > CustomColumnProcessor()))); > > And implement my CustomColumnProcessor where I should convert my row > from the > recordset into my bean, probably with BeanUtils. > > �Is this right?
Yes that is what I'm suggesting although I would never create new BasicRowProcessor and CustomColumnProcessor instances for each query. I would cache them in a static variable and reuse them but the above code works as a basic example. > > If I change BasicRowProcessor or make a custom RowProcessor, with the > changes > I have made, it only introduces a dependency on other package (now > Commons > Converters), and anyone can use it as long as they implement custom > converters > for their particular type conversions. Wherever they choose to use > custom > converters, they just have to register them, with something simolar > to: > > ConvertUtils.register(new FechaConverter(),Fecha.class); > > before they make a query with such a data type. > > Not really sure which of the two alternatives would make code grow > bigger as > the application grows. The RowProcessor and ColumnProcessor interfaces are designed to allow you to use whatever library you like behind the scenes for bean property mapping and population while also allowing the core DbUtils code to remain dependency free and ship as only one jar file. David > > Thanks for your response, and sorry for my english. > > > > Rather than add the dependency we added the ColumnProcessor interface. > > See the process() method javadocs here: > > > > http://jakarta.apache.org/commons/dbutils/apidocs/org/apache/commons/dbutils/ColumnProcessor.html > > > You can implement this interface and use BeanUtils without adding a > > dependency to DbUtils and without changing BasicRowProcessor. > > ColumnProcessor will be included with 1.1 so let us know how it works > for > > you or if it could be improved before release. > > > David > > > > Saludos, > ----------------------- > "Recordad que estamos luchando por el honor de esa mujer, > lo que probablemente es mas de lo que ella hizo jamas." > GROUCHO MARX > ----------------------- > Jorge Morales Pou > Telef�nica I+D, Madrid. > SPAIN > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > __________________________________ Do you Yahoo!? Free Pop-Up Blocker - Get it now http://companion.yahoo.com/ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
