commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kyle Miller <kyle.mil...@sbcglobal.net>
Subject Re: [DbUtils] Generic BasicRowProcessor toBeanList
Date Tue, 11 Jul 2006 15:32:47 GMT
You would lose backwards compatibility with 1.3 and
1.4.

--- Thomas Mueller <hypersql@gmx.net> wrote:

> Hi,
> 
> Currently, you need to do this:
> 
> List<Test> list = (List<Test>)
> BasicRowProcessor.instance().toBeanList(rs,
> Test.class);
> 
> what about using generics?
> 
> List<Test> list =
> BasicRowProcessor.instance().toBeanList(rs,
> Test.class);
> 
> public static <T> List<T> toBeanList(
>         ResultSet rs, 
>         Class<T> clazz) throws SQLException {
>     return (List<T>) toBeanList(rs, clazz);    
> }
> 
> Of course this would be required for other cases as
> well. I'm not sure if you should create a new class
> or overwrite the existing class for the generic
> version. Maybe the Class<T> could be removed in some
> way (I'm not a generics expert). 
> 
> Thomas
> 
> -- 
> 
> 
> Echte DSL-Flatrate dauerhaft für 0,- Euro*!
> "Feel free" mit GMX DSL!
> http://www.gmx.net/de/go/dsl
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> commons-dev-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message