cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r560824 - in /cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src: main/java/org/apache/cayenne/intercept/ test/java/org/apache/cayenne/access/DataContextDecoratedStackTest.java
Date Sun, 29 Jul 2007 21:28:23 GMT
Author: aadamchik
Date: Sun Jul 29 14:28:22 2007
New Revision: 560824

URL: http://svn.apache.org/viewvc?view=rev&rev=560824
Log:
CAY-834 DataContext and DataDomain must support lifecycle callbacks out of the box without
wrapping
(removing unused "intercept" package)

Removed:
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/intercept/
Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/test/java/org/apache/cayenne/access/DataContextDecoratedStackTest.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/test/java/org/apache/cayenne/access/DataContextDecoratedStackTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/test/java/org/apache/cayenne/access/DataContextDecoratedStackTest.java?view=diff&rev=560824&r1=560823&r2=560824
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/test/java/org/apache/cayenne/access/DataContextDecoratedStackTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/test/java/org/apache/cayenne/access/DataContextDecoratedStackTest.java
Sun Jul 29 14:28:22 2007
@@ -23,9 +23,14 @@
 import org.apache.art.Artist;
 import org.apache.cayenne.DataChannel;
 import org.apache.cayenne.DataObjectUtils;
+import org.apache.cayenne.ObjectContext;
+import org.apache.cayenne.QueryResponse;
 import org.apache.cayenne.dba.frontbase.FrontBaseAdapter;
 import org.apache.cayenne.dba.openbase.OpenBaseAdapter;
-import org.apache.cayenne.intercept.DataChannelDecorator;
+import org.apache.cayenne.event.EventManager;
+import org.apache.cayenne.graph.GraphDiff;
+import org.apache.cayenne.map.EntityResolver;
+import org.apache.cayenne.query.Query;
 import org.apache.cayenne.query.SQLTemplate;
 import org.apache.cayenne.unit.CayenneCase;
 
@@ -68,4 +73,45 @@
 
         assertSame(dd, context.getParentDataDomain());
     }
+
+    class DataChannelDecorator implements DataChannel {
+
+        protected DataChannel channel;
+
+        protected DataChannelDecorator() {
+
+        }
+
+        public DataChannelDecorator(DataChannel channel) {
+            setChannel(channel);
+        }
+
+        public EntityResolver getEntityResolver() {
+            return channel.getEntityResolver();
+        }
+
+        public EventManager getEventManager() {
+            return channel.getEventManager();
+        }
+
+        public QueryResponse onQuery(ObjectContext originatingContext, Query query) {
+            return channel.onQuery(originatingContext, query);
+        }
+
+        public GraphDiff onSync(
+                ObjectContext originatingContext,
+                GraphDiff changes,
+                int syncType) {
+            return channel.onSync(originatingContext, changes, syncType);
+        }
+
+        public DataChannel getChannel() {
+            return channel;
+        }
+
+        public void setChannel(DataChannel channel) {
+            this.channel = channel;
+        }
+    }
+
 }



Mime
View raw message