cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1152375 - /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/JointPrefetchTest.java
Date Fri, 29 Jul 2011 21:15:58 GMT
Author: aadamchik
Date: Fri Jul 29 21:15:54 2011
New Revision: 1152375

URL: http://svn.apache.org/viewvc?rev=1152375&view=rev
Log:
CAY-1266 Joint prefetches with fetch limit and offset do not work on Oracle

joint-prefetches-oracle-test.patch by Dzmitry Kazimirchyk

Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/JointPrefetchTest.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/JointPrefetchTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/JointPrefetchTest.java?rev=1152375&r1=1152374&r2=1152375&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/JointPrefetchTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/JointPrefetchTest.java
Fri Jul 29 21:15:54 2011
@@ -114,6 +114,34 @@ public class JointPrefetchTest extends S
         tPainting.insert(33003, "P_artist21", 33002, 3000, 33002);
     }
     
+    public void testJointPrefetchWithFetchLimit() throws Exception {
+        createJointPrefetchDataSet1();
+        
+        SelectQuery q = new SelectQuery(Painting.class);
+        q.setFetchLimit(2);
+        q.setFetchOffset(0);
+        q.addOrdering("db:PAINTING_ID", SortOrder.ASCENDING);
+        q.addPrefetch(Painting.TO_ARTIST_PROPERTY).setSemantics(
+                PrefetchTreeNode.JOINT_PREFETCH_SEMANTICS);
+        
+        final List<?> objects = context.performQuery(q);
+        
+        queryInterceptor.runWithQueriesBlocked(new UnitTestClosure() {
+            
+            public void execute() {
+                assertEquals(2, objects.size());
+
+                Iterator<?> it = objects.iterator();
+                while (it.hasNext()) {
+                    Painting p = (Painting) it.next();
+                    Artist target = p.getToArtist();
+                    assertNotNull(target);
+                    assertEquals(PersistenceState.COMMITTED, target.getPersistenceState());
+                }
+            }
+        });
+    }
+    
     public void testJointPrefetchDataRows() throws Exception {
         createJointPrefetchDataSet1();
 



Mime
View raw message