Updated BeanPropertyRowMapper to remove spaces from column names to improve matching to properties (SPR-5758)

This commit is contained in:
Thomas Risberg
2009-06-02 20:58:44 +00:00
parent 3192b926ea
commit 8079262705
4 changed files with 167 additions and 4 deletions

View File

@@ -236,8 +236,8 @@ public class BeanPropertyRowMapper<T> implements RowMapper<T> {
Set<String> populatedProperties = (isCheckFullyPopulated() ? new HashSet<String>() : null);
for (int index = 1; index <= columnCount; index++) {
String column = JdbcUtils.lookupColumnName(rsmd, index).toLowerCase();
PropertyDescriptor pd = this.mappedFields.get(column);
String column = JdbcUtils.lookupColumnName(rsmd, index);
PropertyDescriptor pd = this.mappedFields.get(column.replaceAll(" ", "").toLowerCase());
if (pd != null) {
try {
Object value = getColumnValue(rs, index, pd);