You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by df...@apache.org on 2009/02/09 20:44:19 UTC
svn commit: r742701 -
/commons/sandbox/dbutils/bugfixing/src/java/org/apache/commons/dbutils/BeanProcessor.java
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);