You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Dan Fabulich (JIRA)" <ji...@apache.org> on 2009/11/03 21:23:32 UTC

[jira] Closed: (DBUTILS-57) BeanProcessor not able to map an alias column from a HSQLDB query to the any bean properties

     [ https://issues.apache.org/jira/browse/DBUTILS-57?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dan Fabulich closed DBUTILS-57.
-------------------------------

       Resolution: Fixed
    Fix Version/s: 1.3

Committed revision 832535.  Thanks for the patch!

> BeanProcessor not able to map an alias column from a HSQLDB query to the any bean properties
> --------------------------------------------------------------------------------------------
>
>                 Key: DBUTILS-57
>                 URL: https://issues.apache.org/jira/browse/DBUTILS-57
>             Project: Commons DbUtils
>          Issue Type: Bug
>         Environment: hsqldb-1.9.0-rc4 memory mode
> DBUtils 1.2
>            Reporter: Wynand
>             Fix For: 1.3
>
>         Attachments: BeanProcessor.patch, BeanProcessorTest.patch
>
>
> Using a query with an alias, hsqldb engine doesn't populate the column name metadata only the column label metadata.
> In such a case the column isn't mapped.
> To resolve this, the column label should be used in case the column name is not available.
> Here is a snippet from org.apache.commons.dbutils.BeanProcessor.mapColumnsToProperties line 393 : 
> ...
>        for (int col = 1; col <= cols; col++) {            
>             String columnName = rsmd.getColumnName(col);
>            // columnName is empty, revert to column label
>             if (columnName.length() == 0) {
>                 columnName = rsmd.getColumnLabel(col);
>             }            
>             ...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.