commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Speirs <bill.spe...@gmail.com>
Subject Re: svn commit: r1205609 - in /commons/proper/dbutils/trunk/src/main/java/org/apache/commons/dbutils: AsyncQueryRunner.java QueryRunner.java handlers/BeanMapHandler.java handlers/ColumnListHandler.java handlers/KeyedHandler.java handlers/ScalarHandle
Date Fri, 25 Nov 2011 17:59:02 GMT
On Fri, Nov 25, 2011 at 12:28 PM, sebb <sebbaz@gmail.com> wrote:
>> As we discussed before, this exception will be thrown if the column
>> type doesn't match the generic type. Because of type erasure I don't
>> know of any way to validate the types.
>
> What determines the column type?

As far as I know, the column type is determined by the table schema
for the datbase, and the JDBC driver.

> If the user codes correctly to the API, is it possible for the CCE to be thrown?

If the user properly matches the generic with what is in the table
schema, a CCE should not be thrown.

> Part of the idea of generics is to do away with unnecessary casts and
> instanceof checks; adding inappropriate @SuppressWarnings tags negates
> the benefit (and can even make things worse).

Because we only have the getObject method (there are other JDBC
methods; however, we cannot pick the correct method because of type
erasure), there will need to be a cast. However, this cast is done by
the library, so the user is not forced to cast.

Bill-

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


Mime
View raw message