cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r562362 - /cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/DataDomainInsertBucket.java
Date Fri, 03 Aug 2007 07:15:32 GMT
Author: aadamchik
Date: Fri Aug  3 00:15:30 2007
New Revision: 562362

URL: http://svn.apache.org/viewvc?view=rev&rev=562362
Log:
CAY-835 setting meaningful pk to zero turn on autogenerated keys

Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/DataDomainInsertBucket.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/DataDomainInsertBucket.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/DataDomainInsertBucket.java?view=diff&rev=562362&r1=562361&r2=562362
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/DataDomainInsertBucket.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/DataDomainInsertBucket.java
Fri Aug  3 00:15:30 2007
@@ -144,8 +144,15 @@
                             .readPropertyDirectly(object);
 
                     if (value != null) {
-                        // treat numeric zero values as nulls requiring generation
-                        if (!(value instanceof Number && ((Number) value).intValue()
== 0)) {
+                        Class javaClass = objAttr.getJavaClass();
+                        if (javaClass.isPrimitive()
+                                && value instanceof Number
+                                && ((Number) value).intValue() == 0) {
+                            // primitive 0 has to be treated as NULL, or otherwise we
+                            // can't generate PK for POJO's
+                        }
+                        else {
+
                             idMap.put(dbAttrName, value);
                             continue;
                         }



Mime
View raw message