cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1553817 - /cayenne/main/branches/STABLE-3.1/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/SelectTranslator.java
Date Sat, 28 Dec 2013 12:11:16 GMT
Author: aadamchik
Date: Sat Dec 28 12:11:16 2013
New Revision: 1553817

URL: http://svn.apache.org/r1553817
Log:
CAY-1885 Null value in subclass's field.

patch by Oleg Artyukevich

Modified:
    cayenne/main/branches/STABLE-3.1/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/SelectTranslator.java

Modified: cayenne/main/branches/STABLE-3.1/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/SelectTranslator.java
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.1/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/SelectTranslator.java?rev=1553817&r1=1553816&r2=1553817&view=diff
==============================================================================
--- cayenne/main/branches/STABLE-3.1/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/SelectTranslator.java
(original)
+++ cayenne/main/branches/STABLE-3.1/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/SelectTranslator.java
Sat Dec 28 12:11:16 2013
@@ -574,19 +574,21 @@ public class SelectTranslator extends Qu
             // record ObjAttribute override
             for (ColumnDescriptor column : columns) {
                 if (attribute.getName().equals(column.getName())) {
+                    
+                    if (attributeOverrides == null) {
+                        attributeOverrides = new HashMap<ObjAttribute, ColumnDescriptor>();
+                    }
 
                     // kick out the original attribute
                     ObjAttribute original = defaultAttributesByColumn.remove(column);
 
                     if (original != null) {
-                        if (attributeOverrides == null) {
-                            attributeOverrides = new HashMap<ObjAttribute, ColumnDescriptor>();
-                        }
-
                         attributeOverrides.put(original, column);
-                        column.setJavaClass(Void.TYPE.getName());
                     }
 
+                    attributeOverrides.put(objAttribute, column);
+                    column.setJavaClass(Void.TYPE.getName());
+                    
                     break;
                 }
             }



Mime
View raw message