You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by th...@apache.org on 2022/12/04 14:57:58 UTC

[commons-dbutils] branch master updated: Be generous on result column having spaces.

This is an automated email from the ASF dual-hosted git repository.

thecarlhall pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-dbutils.git


The following commit(s) were added to refs/heads/master by this push:
     new 9e901dd  Be generous on result column having spaces.
     new 50e785f  Merge pull request #104 from prasad83/master
9e901dd is described below

commit 9e901ddff3a3286377dfa7b10d3544d32c585eef
Author: prasad83 <pr...@users.noreply.github.com>
AuthorDate: Sat Jan 29 20:54:02 2022 +0530

    Be generous on result column having spaces.
    
    Query of type (show create table) in MySQL returns result with column header having spaces (Create Table)
    This should be mapped to createTable prop using generousName transformation.
---
 src/main/java/org/apache/commons/dbutils/GenerousBeanProcessor.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/commons/dbutils/GenerousBeanProcessor.java b/src/main/java/org/apache/commons/dbutils/GenerousBeanProcessor.java
index b6fe389..404b84c 100644
--- a/src/main/java/org/apache/commons/dbutils/GenerousBeanProcessor.java
+++ b/src/main/java/org/apache/commons/dbutils/GenerousBeanProcessor.java
@@ -52,7 +52,7 @@ public class GenerousBeanProcessor extends BeanProcessor {
                 columnName = rsmd.getColumnName(col);
             }
 
-            final String generousColumnName = columnName.replace("_", "");
+            final String generousColumnName = columnName.replace("_", "").replace(" ", "");
 
             for (int i = 0; i < props.length; i++) {
                 final String propName = props[i].getName();