cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r560825 - /cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/ResourceLocalEntityManagerFactory.java
Date Sun, 29 Jul 2007 21:34:45 GMT
Author: aadamchik
Date: Sun Jul 29 14:34:44 2007
New Revision: 560825

URL: http://svn.apache.org/viewvc?view=rev&rev=560825
Log:
CAY-834 DataContext and DataDomain must support lifecycle callbacks out of the box without
wrapping
(updating JPA stack)

Modified:
    cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/ResourceLocalEntityManagerFactory.java

Modified: cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/ResourceLocalEntityManagerFactory.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/ResourceLocalEntityManagerFactory.java?view=diff&rev=560825&r1=560824&r2=560825
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/ResourceLocalEntityManagerFactory.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/ResourceLocalEntityManagerFactory.java
Sun Jul 29 14:34:44 2007
@@ -27,11 +27,7 @@
 import javax.persistence.spi.PersistenceUnitInfo;
 
 import org.apache.cayenne.ObjectContext;
-import org.apache.cayenne.access.DataContext;
 import org.apache.cayenne.access.DataDomain;
-import org.apache.cayenne.access.ObjectStore;
-import org.apache.cayenne.intercept.DataChannelCallbackInterceptor;
-import org.apache.cayenne.intercept.ObjectContextCallbackInterceptor;
 
 /**
  * A Cayenne EntityManagerFactory that supports resource-local transactions.
@@ -110,7 +106,9 @@
      */
     public EntityManager createEntityManager(Map map) {
         checkClosed();
-        CayenneEntityManager em = new ResourceLocalEntityManager(createObjectContext(), this);
+        CayenneEntityManager em = new ResourceLocalEntityManager(
+                createObjectContext(),
+                this);
         return new TypeCheckingEntityManager(em);
     }
 
@@ -120,14 +118,7 @@
      * environment.
      */
     protected ObjectContext createObjectContext() {
-        DataChannelCallbackInterceptor postInterceptor = new DataChannelCallbackInterceptor();
-        postInterceptor.setChannel(domain);
-        ObjectStore objectStore = new ObjectStore(domain.getSharedSnapshotCache());
-
-        ObjectContextCallbackInterceptor preInterceptor = new ObjectContextCallbackInterceptor();
-        preInterceptor.setContext(new DataContext(postInterceptor, objectStore));
-
-        return preInterceptor;
+        return domain.createDataContext();
     }
 
     /**



Mime
View raw message