You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by gb...@apache.org on 2010/09/23 16:57:16 UTC

svn commit: r1000488 - /pivot/trunk/core/src/org/apache/pivot/sql/ResultList.java

Author: gbrown
Date: Thu Sep 23 14:57:16 2010
New Revision: 1000488

URL: http://svn.apache.org/viewvc?rev=1000488&view=rev
Log:
Re-introduce includeNullValues property to ResultList.

Modified:
    pivot/trunk/core/src/org/apache/pivot/sql/ResultList.java

Modified: pivot/trunk/core/src/org/apache/pivot/sql/ResultList.java
URL: http://svn.apache.org/viewvc/pivot/trunk/core/src/org/apache/pivot/sql/ResultList.java?rev=1000488&r1=1000487&r2=1000488&view=diff
==============================================================================
--- pivot/trunk/core/src/org/apache/pivot/sql/ResultList.java (original)
+++ pivot/trunk/core/src/org/apache/pivot/sql/ResultList.java Thu Sep 23 14:57:16 2010
@@ -162,6 +162,11 @@ public class ResultList implements List<
                        value = null;
                    }
 
+                   if (value != null || includeNullValues) {
+                       String key = (field.key == null) ? field.columnName : field.key;
+                       item.put(key, value);
+                   }
+
                    item.put((field.key == null) ? field.columnName : field.key, value);
                }
            } catch (SQLException exception) {
@@ -180,8 +185,8 @@ public class ResultList implements List<
    }
 
    private ResultSet resultSet;
-
    private ArrayList<Field> fields = new ArrayList<Field>();
+   private boolean includeNullValues = false;
 
    private ListListenerList<Map<String, Object>> listListeners = new ListListenerList<Map<String,Object>>();
 
@@ -217,6 +222,14 @@ public class ResultList implements List<
        setFields(new ArrayAdapter<Field>(fields));
    }
 
+   public boolean getIncludeNullValues() {
+       return includeNullValues;
+   }
+
+   public void setIncludeNullValues(boolean includeNullValues) {
+       this.includeNullValues = includeNullValues;
+   }
+
    @Override
    public int add(Map<String, Object> item) {
        throw new UnsupportedOperationException();