cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1553812 - /cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/trans/SelectTranslator.java
Date Sat, 28 Dec 2013 12:05:40 GMT
Author: aadamchik
Date: Sat Dec 28 12:05:39 2013
New Revision: 1553812

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

patch by Oleg Artyukevich

Modified:
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/trans/SelectTranslator.java

Modified: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/trans/SelectTranslator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/trans/SelectTranslator.java?rev=1553812&r1=1553811&r2=1553812&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/trans/SelectTranslator.java
(original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/trans/SelectTranslator.java
Sat Dec 28 12:05:39 2013
@@ -540,19 +540,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