Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
3.0 Beta 9
-
None
Description
Create a database using MySQL with unsigned integer types using camelCase (which should represent java Long values as specified). Query the database with a HashMap return result. Result from a query returns 2 mapped results for each parameter, one capitalized, one using the original camelCase parameter, and one in all upper case. The upper case value is correct (a Long value). The camelCase parameter is downcast to an Integer.
I traced it to UnknownTypeHandler.java line 62. For the camelCase mappings, there is a ResultSetMetaData entry, and the entry returns a JdbcType of INTEGER which is correct. The rsmd.getColumnClassName is java.long.Long (which should be a huge hint as to the java type, but you don't retrieve that value).
You then poll your typeHandlerRegistry and return an Integer java type converter, which is very incorrect. The result is that the result is downcast to an Integer instead of a long causing data loss and programatic errors where a Long is expected and instead an Integer is provided.