cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From skolbac...@apache.org
Subject [1/2] cayenne git commit: fix NullPointerException for nested ObjectContext
Date Tue, 10 Mar 2015 11:06:26 GMT
Repository: cayenne
Updated Branches:
  refs/heads/master 9039b8a43 -> b32a7df26


fix NullPointerException for nested ObjectContext


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

Branch: refs/heads/master
Commit: bc4933dde64cb28edae9de8e7b1413e1f5f15339
Parents: c110454
Author: Savva Kolbachev <s.kolbachev@gmail.com>
Authored: Tue Mar 10 13:58:44 2015 +0300
Committer: Savva Kolbachev <s.kolbachev@gmail.com>
Committed: Tue Mar 10 13:58:44 2015 +0300

----------------------------------------------------------------------
 .../configuration/server/DataContextFactory.java      |  1 +
 .../cayenne/access/NestedDataContextReadIT.java       | 14 ++++++++++++++
 2 files changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/bc4933dd/cayenne-server/src/main/java/org/apache/cayenne/configuration/server/DataContextFactory.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/configuration/server/DataContextFactory.java
b/cayenne-server/src/main/java/org/apache/cayenne/configuration/server/DataContextFactory.java
index 82e0504..b6b51a1 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/configuration/server/DataContextFactory.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/configuration/server/DataContextFactory.java
@@ -103,6 +103,7 @@ public class DataContextFactory implements ObjectContextFactory {
         context.setValidatingObjectsOnCommit(parent.isValidatingObjectsOnCommit());
         context.setUsingSharedSnapshotCache(parent.isUsingSharedSnapshotCache());
         context.setQueryCache(new NestedQueryCache(queryCache));
+        context.setTransactionFactory(transactionFactory);
 
         return context;
     }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/bc4933dd/cayenne-server/src/test/java/org/apache/cayenne/access/NestedDataContextReadIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/NestedDataContextReadIT.java
b/cayenne-server/src/test/java/org/apache/cayenne/access/NestedDataContextReadIT.java
index 558c64e..cac997d 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/NestedDataContextReadIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/NestedDataContextReadIT.java
@@ -186,6 +186,20 @@ public class NestedDataContextReadIT extends ServerCase {
     }
 
     @Test
+    public void testPageableSelect() throws Exception {
+        createArtistsDataSet();
+        ObjectContext child = runtime.newContext(context);
+
+        SelectQuery<Artist> query = SelectQuery.query(Artist.class);
+        query.addOrdering(Artist.ARTIST_NAME.desc());
+        query.setPageSize(1);
+        IncrementalFaultList<Artist> records = (IncrementalFaultList) child.performQuery(query);
+
+        assertEquals(4, records.size());
+        assertEquals(1, records.getPageSize());
+    }
+
+    @Test
     public void testReadToOneRelationship() throws Exception {
         createRelationshipDataSet();
 


Mime
View raw message