cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r489305 - in /incubator/cayenne/main/branches/STABLE-2.0/cayenne: cayenne-java/src/cayenne/java/org/apache/cayenne/access/DataDomainQueryAction.java cayenne-other/release-notes/RELEASE-NOTES-2.0-incubating-SNAPSHOT.txt
Date Thu, 21 Dec 2006 09:58:30 GMT
Author: aadamchik
Date: Thu Dec 21 01:58:29 2006
New Revision: 489305

URL: http://svn.apache.org/viewvc?view=rev&rev=489305
Log:
CAY-724 - aplying 3.0 fix to 2.0 branch

Modified:
    incubator/cayenne/main/branches/STABLE-2.0/cayenne/cayenne-java/src/cayenne/java/org/apache/cayenne/access/DataDomainQueryAction.java
    incubator/cayenne/main/branches/STABLE-2.0/cayenne/cayenne-other/release-notes/RELEASE-NOTES-2.0-incubating-SNAPSHOT.txt

Modified: incubator/cayenne/main/branches/STABLE-2.0/cayenne/cayenne-java/src/cayenne/java/org/apache/cayenne/access/DataDomainQueryAction.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/branches/STABLE-2.0/cayenne/cayenne-java/src/cayenne/java/org/apache/cayenne/access/DataDomainQueryAction.java?view=diff&rev=489305&r1=489304&r2=489305
==============================================================================
--- incubator/cayenne/main/branches/STABLE-2.0/cayenne/cayenne-java/src/cayenne/java/org/apache/cayenne/access/DataDomainQueryAction.java
(original)
+++ incubator/cayenne/main/branches/STABLE-2.0/cayenne/cayenne-java/src/cayenne/java/org/apache/cayenne/access/DataDomainQueryAction.java
Thu Dec 21 01:58:29 2006
@@ -72,6 +72,7 @@
     Map prefetchResultsByPath;
     Map queriesByNode;
     Map queriesByExecutedQueries;
+    boolean noObjectConversion;
 
     /*
      * A constructor for the "new" way of performing a query via 'execute' with
@@ -111,8 +112,9 @@
             }
         }
 
-        // turn results to objects
-        interceptObjectConversion();
+        if (!noObjectConversion) {
+            interceptObjectConversion();
+        }
 
         return response;
     }
@@ -191,25 +193,21 @@
 
             DataRow targetRow = cache.getCachedSnapshot(targetId);
 
-            DataRow resultRow;
-
             if (targetRow != null) {
-                resultRow = targetRow;
-            }
-            // if no inheritance involved, we can return a valid partial row made from
-            // the target Id alone...
-            else if (domain.getEntityResolver().lookupInheritanceTree(
-                    (ObjEntity) relationship.getTargetEntity()) == null) {
-
-                resultRow = new DataRow(targetId.getIdSnapshot());
+                this.response = new GenericResponse(Collections.singletonList(targetRow));
+                return DONE;
             }
-            else {
-                // can't guess the right target...
-                return !DONE;
+            // a hack to prevent passing partial snapshots to ObjectResolver ... See
+            // CAY-724 for details.
+            else if (context != null
+                    && domain.getEntityResolver().lookupInheritanceTree(
+                            (ObjEntity) relationship.getTargetEntity()) == null) {
+
+                this.noObjectConversion = true;
+                Object object = context.localObject(targetId, null);
+                this.response = new GenericResponse(Collections.singletonList(object));
+                return DONE;
             }
-
-            this.response = new GenericResponse(Collections.singletonList(resultRow));
-            return DONE;
         }
 
         return !DONE;

Modified: incubator/cayenne/main/branches/STABLE-2.0/cayenne/cayenne-other/release-notes/RELEASE-NOTES-2.0-incubating-SNAPSHOT.txt
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/branches/STABLE-2.0/cayenne/cayenne-other/release-notes/RELEASE-NOTES-2.0-incubating-SNAPSHOT.txt?view=diff&rev=489305&r1=489304&r2=489305
==============================================================================
--- incubator/cayenne/main/branches/STABLE-2.0/cayenne/cayenne-other/release-notes/RELEASE-NOTES-2.0-incubating-SNAPSHOT.txt
(original)
+++ incubator/cayenne/main/branches/STABLE-2.0/cayenne/cayenne-other/release-notes/RELEASE-NOTES-2.0-incubating-SNAPSHOT.txt
Thu Dec 21 01:58:29 2006
@@ -19,6 +19,7 @@
 CAY-653 overriding setPersistentState() in unreliable in three tier environment with CayenneContext
 CAY-690 Exception in the Modeler when changing schema on derived entities
 CAY-712 Allow modifying objects in validate* methods
+CAY-724 - applying 3.0 fix to 1.2 branch
 
 
 ----------------------------------



Mime
View raw message