You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by aa...@apache.org on 2011/04/08 07:34:52 UTC

svn commit: r1090119 - in /cayenne/main/branches/STABLE-3.0: docs/doc/src/main/resources/RELEASE-NOTES.txt framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataDomainInsertBucket.java

Author: aadamchik
Date: Fri Apr  8 05:34:52 2011
New Revision: 1090119

URL: http://svn.apache.org/viewvc?rev=1090119&view=rev
Log:
CAY-1444 NPE when persisting a newly instatiated object

patch by Dzmitry Kazimirchyk
(taken from trunk sans unit tests - too lazy to merge them properly to 3.0)

Modified:
    cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/RELEASE-NOTES.txt
    cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataDomainInsertBucket.java

Modified: cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/RELEASE-NOTES.txt
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/RELEASE-NOTES.txt?rev=1090119&r1=1090118&r2=1090119&view=diff
==============================================================================
--- cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/RELEASE-NOTES.txt (original)
+++ cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/RELEASE-NOTES.txt Fri Apr  8 05:34:52 2011
@@ -19,6 +19,7 @@ CAY-1500 MySQL JDBC Batching
 Bug Fixes Since 3.0.1:
 
 CAY-1403 Method "readNestedProperty" Should Resolve Through Iterative Invocations onto DataObject and Not Complete Within Cayenne.readNestedProperty
+CAY-1444 NPE when persisting a newly instatiated object
 CAY-1456 Investigate auto-increment columns on DB2 and switch the adapter policy to support them
 CAY-1484 Flattened attribute queries are incorrectly generated
 CAY-1485 Memory information for about dialog

Modified: cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataDomainInsertBucket.java
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataDomainInsertBucket.java?rev=1090119&r1=1090118&r2=1090119&view=diff
==============================================================================
--- cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataDomainInsertBucket.java (original)
+++ cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataDomainInsertBucket.java Fri Apr  8 05:34:52 2011
@@ -20,6 +20,7 @@
 package org.apache.cayenne.access;
 
 import java.util.Collection;
+import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
@@ -80,6 +81,12 @@ class DataDomainInsertBucket extends Dat
                     Map<Object, Object> snapshot = diffBuilder.buildDBDiff(parent
                             .objectDiff(o.getObjectId()));
 
+                    // we need to insert even if there is no changes to default values
+                    // so creating an empty changes map
+                    if (snapshot == null) {
+                        snapshot = new HashMap<Object, Object>();
+                    }
+
                     batch.add(snapshot, o.getObjectId());
                 }
             }