commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Speirs <>
Subject Re: svn commit: r1205609 - in /commons/proper/dbutils/trunk/src/main/java/org/apache/commons/dbutils: handlers/ handlers/ handlers/ handlers/ScalarHandle
Date Fri, 25 Nov 2011 17:59:02 GMT
On Fri, Nov 25, 2011 at 12:28 PM, sebb <> 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.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message