commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dmitry Mamonov (JIRA)" <>
Subject [jira] Commented: (DBUTILS-24) [dbutils] Modify BasicRowProcessor to use the column label
Date Wed, 07 Oct 2009 09:37:31 GMT


Dmitry Mamonov commented on DBUTILS-24:

I'm using mysql-connector-java-5.1.7-bin.jar driver. Here is my problem:
SELECT as parentName, as childName
FROM peoples parent
LEFT JOIN peoples child on child.parentId =
WHERE ....;

This way getColumnName() method returns "name" for 1st column, and (sic!) name for 2nd column,
so I cant reach values from first colum at all using  MapListHandler for example.

I'm fixing it manually changing getColumnName() to getColumnLabel() in BasicRowProcessor class,

but it looks not so cute.

> [dbutils] Modify BasicRowProcessor to use the column label
> ----------------------------------------------------------
>                 Key: DBUTILS-24
>                 URL:
>             Project: Commons DbUtils
>          Issue Type: Improvement
>         Environment: Operating System: other
> Platform: Other
>            Reporter: gene
>            Priority: Minor
> BasicRowProcessor.mapColumnsToProperties currently uses 'getColumnName' to 
> determine what property to set on the bean. It would be more flexible if it 
> used 'getColumnLabel'. This would allow the developer to specify the property 
> name as an alias to a column in the sql query.
> For example 'select last_name lastname, first_name firstname from employee'. 
> Note that 'getColumnLabel' will defaults to the column name if no alias is 
> specified in the query.

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

View raw message