cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject [1/2] cayenne git commit: CAY-2015 Joint prefetches combined with DisjointById prefetches return null incorrectly
Date Sun, 05 Jul 2015 09:59:13 GMT
Repository: cayenne
Updated Branches:
  refs/heads/master 0479e2586 -> 9b94f2d79


CAY-2015 Joint prefetches combined with DisjointById prefetches return null incorrectly

unit test by John Huss


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/1ce24022
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/1ce24022
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/1ce24022

Branch: refs/heads/master
Commit: 1ce240228c7e176709f9badb1eee1dc0cf529359
Parents: 0479e25
Author: aadamchik <aadamchik@apache.org>
Authored: Sat Jul 4 11:58:51 2015 -0400
Committer: aadamchik <aadamchik@apache.org>
Committed: Sat Jul 4 11:58:51 2015 -0400

----------------------------------------------------------------------
 .../cayenne/access/DataContextPrefetchIT.java   | 26 ++++++++++++++++++++
 1 file changed, 26 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/1ce24022/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextPrefetchIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextPrefetchIT.java
b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextPrefetchIT.java
index a635b21..706c759 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextPrefetchIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextPrefetchIT.java
@@ -820,4 +820,30 @@ public class DataContextPrefetchIT extends ServerCase {
             }
         });
     }
+    
+    @Test
+    public void testPrefetchJointAndDisjointByIdTogether() throws Exception {
+        createArtistWithTwoPaintingsAndTwoInfosDataSet();
+
+        SelectQuery<Painting> query = new SelectQuery<Painting>(Painting.class);
+        query.andQualifier(Painting.PAINTING_TITLE.eq("p_artist2"));
+        query.addPrefetch(Painting.TO_ARTIST.joint());
+        query.addPrefetch(Painting.TO_PAINTING_INFO.disjointById());
+        final List<Painting> results = context.select(query);
+
+        queryInterceptor.runWithQueriesBlocked(new UnitTestClosure() {
+
+            public void execute() {
+                assertEquals(1, results.size());
+
+                Painting p0 = results.get(0);
+                Artist a0 = (Artist) p0.readPropertyDirectly(Painting.TO_ARTIST.getName());
+                assertNotNull(a0);
+                
+                PaintingInfo info = (PaintingInfo)p0.readPropertyDirectly(Painting.TO_PAINTING_INFO.getName());
+                assertNotNull(info);
+            }
+        });
+    }
+    
 }


Mime
View raw message