commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dfabul...@apache.org
Subject svn commit: r742701 - /commons/sandbox/dbutils/bugfixing/src/java/org/apache/commons/dbutils/BeanProcessor.java
Date Mon, 09 Feb 2009 19:44:19 GMT
Author: dfabulich
Date: Mon Feb  9 19:44:18 2009
New Revision: 742701

URL: http://svn.apache.org/viewvc?rev=742701&view=rev
Log:
[DBUTILS-42] Object with Long or Decimal got initial zero value while database field is null
Submitted by: Brandon Atkinson

Modified:
    commons/sandbox/dbutils/bugfixing/src/java/org/apache/commons/dbutils/BeanProcessor.java

Modified: commons/sandbox/dbutils/bugfixing/src/java/org/apache/commons/dbutils/BeanProcessor.java
URL: http://svn.apache.org/viewvc/commons/sandbox/dbutils/bugfixing/src/java/org/apache/commons/dbutils/BeanProcessor.java?rev=742701&r1=742700&r2=742701&view=diff
==============================================================================
--- commons/sandbox/dbutils/bugfixing/src/java/org/apache/commons/dbutils/BeanProcessor.java
(original)
+++ commons/sandbox/dbutils/bugfixing/src/java/org/apache/commons/dbutils/BeanProcessor.java
Mon Feb  9 19:44:18 2009
@@ -432,7 +432,11 @@
      */
     protected Object processColumn(ResultSet rs, int index, Class propType)
         throws SQLException {
-
+    	
+    	if ( !propType.isPrimitive() && rs.getObject(index) == null ) {
+    		return null;
+    	}
+    	
         if (propType.equals(String.class)) {
             return rs.getString(index);
             



Mime
View raw message