cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r821328 - in /cayenne/main/trunk/framework: cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/ cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/ cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/ ca...
Date Sat, 03 Oct 2009 14:31:21 GMT
Author: aadamchik
Date: Sat Oct  3 14:31:19 2009
New Revision: 821328

URL: http://svn.apache.org/viewvc?rev=821328&view=rev
Log:
CAY-1281 Lifecycle callbacks reorganization

pre-add should actually be post-add

Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/LifecycleListener.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataContext.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/CallbackMap.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/LifecycleEvent.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/MapLoader.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/reflect/LifecycleCallbackRegistry.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/resources/org/apache/cayenne/schema/3.0/modelMap.xsd
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/art/Artist.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/art/Painting.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CayenneContextServerDiffsTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CayenneContextWithDataContextTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextCallbacksTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/map/CallbackDescriptorTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/remote/ClientChannelServerDiffsTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/resources/locking.map.xml
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/resources/testmap.map.xml
    cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/bridge/DataMapConverter.java
    cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/AbstractCallbackMethodsTab.java
    cayenne/main/trunk/framework/cayenne-modeler/src/main/resources/pref/ModelerPreferences.map.xml

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/LifecycleListener.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/LifecycleListener.java?rev=821328&r1=821327&r2=821328&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/LifecycleListener.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/LifecycleListener.java
Sat Oct  3 14:31:19 2009
@@ -30,7 +30,7 @@
  */
 public interface LifecycleListener {
 
-    void preAdd(Object entity);
+    void postAdd(Object entity);
 
     void postPersist(Object entity);
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataContext.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataContext.java?rev=821328&r1=821327&r2=821328&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataContext.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataContext.java
Sat Oct  3 14:31:19 2009
@@ -733,7 +733,7 @@
 
         // invoke callbacks
         getEntityResolver().getCallbackRegistry().performCallbacks(
-                LifecycleEvent.PRE_ADD,
+                LifecycleEvent.POST_ADD,
                 object);
 
         return object;
@@ -874,7 +874,7 @@
 
         // invoke callbacks
         getEntityResolver().getCallbackRegistry().performCallbacks(
-                LifecycleEvent.PRE_ADD,
+                LifecycleEvent.POST_ADD,
                 persistent);
     }
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/CallbackMap.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/CallbackMap.java?rev=821328&r1=821327&r2=821328&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/CallbackMap.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/CallbackMap.java
Sat Oct  3 14:31:19 2009
@@ -73,8 +73,8 @@
         return callbacks[LifecycleEvent.POST_UPDATE.ordinal()];
     }
 
-    public CallbackDescriptor getPreAdd() {
-        return callbacks[LifecycleEvent.PRE_ADD.ordinal()];
+    public CallbackDescriptor getPostAdd() {
+        return callbacks[LifecycleEvent.POST_ADD.ordinal()];
     }
     
     public CallbackDescriptor getPrePersist() {
@@ -90,7 +90,7 @@
     }
 
     public void encodeCallbacksAsXML(XMLEncoder encoder) {
-        printMethods(getPreAdd(), "pre-add", encoder);
+        printMethods(getPostAdd(), "post-add", encoder);
         printMethods(getPrePersist(), "pre-persist", encoder);
         printMethods(getPostPersist(), "post-persist", encoder);
         printMethods(getPreUpdate(), "pre-update", encoder);

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/LifecycleEvent.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/LifecycleEvent.java?rev=821328&r1=821327&r2=821328&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/LifecycleEvent.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/LifecycleEvent.java
Sat Oct  3 14:31:19 2009
@@ -24,5 +24,5 @@
  * @since 3.0
  */
 public enum LifecycleEvent {
-    PRE_ADD, PRE_REMOVE, PRE_UPDATE, POST_PERSIST, POST_REMOVE, POST_UPDATE, POST_LOAD, PRE_PERSIST;
+    POST_ADD, PRE_REMOVE, PRE_UPDATE, POST_PERSIST, POST_REMOVE, POST_UPDATE, POST_LOAD,
PRE_PERSIST;
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/MapLoader.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/MapLoader.java?rev=821328&r1=821327&r2=821328&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/MapLoader.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/MapLoader.java
Sat Oct  3 14:31:19 2009
@@ -86,7 +86,7 @@
 
     // lifecycle listeners and callbacks related
     public static final String ENTITY_LISTENER_TAG = "entity-listener";
-    public static final String PRE_ADD_TAG = "pre-add";
+    public static final String POST_ADD_TAG = "post-add";
     public static final String PRE_PERSIST_TAG = "pre-persist";
     public static final String POST_PERSIST_TAG = "post-persist";
     public static final String PRE_UPDATE_TAG = "pre-update";
@@ -359,11 +359,11 @@
             }
         });
 
-        startTagOpMap.put(PRE_ADD_TAG, new StartClosure() {
+        startTagOpMap.put(POST_ADD_TAG, new StartClosure() {
 
             @Override
             void execute(Attributes attributes) throws SAXException {
-                processStartPreAdd(attributes);
+                processStartPostAdd(attributes);
             }
         });
 
@@ -604,24 +604,24 @@
         entityListener = null;
     }
 
-    private void processStartPreAdd(Attributes attributes) {
+    private void processStartPostAdd(Attributes attributes) {
         String methodName = attributes.getValue("", "method-name");
         if (entityListener != null) {
             // new "entity-listener" tag as a child of "obj-entity"
-            entityListener.getCallbackMap().getPreAdd().addCallbackMethod(methodName);
+            entityListener.getCallbackMap().getPostAdd().addCallbackMethod(methodName);
         }
         else if (objEntity != null) {
             // new callback tags - children of "obj-entity"
-            objEntity.getCallbackMap().getPreAdd().addCallbackMethod(methodName);
+            objEntity.getCallbackMap().getPostAdd().addCallbackMethod(methodName);
         }
     }
 
     private void processStartPrePersist(Attributes attributes) {
 
-        // 3.0 -> 3.0.0.1 upgrade hack... treat pre-persist as pre-add
-        // only 3.0 used "pre-persist" in a "pre-add" sense
+        // 3.0 -> 3.0.0.1 upgrade hack... treat pre-persist as post-add
+        // only 3.0 used "pre-persist" in a "post-add" sense
         if ("3.0".equals(mapVersion)) {
-            processStartPreAdd(attributes);
+            processStartPostAdd(attributes);
         }
         else {
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/reflect/LifecycleCallbackRegistry.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/reflect/LifecycleCallbackRegistry.java?rev=821328&r1=821327&r2=821328&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/reflect/LifecycleCallbackRegistry.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/reflect/LifecycleCallbackRegistry.java
Sat Oct  3 14:31:19 2009
@@ -74,7 +74,7 @@
      * methods in this class can be used to register arbitrary listeners.
      */
     public void addDefaultListener(LifecycleListener listener) {
-        addDefaultListener(LifecycleEvent.PRE_ADD, listener, "preAdd");
+        addDefaultListener(LifecycleEvent.POST_ADD, listener, "postAdd");
         addDefaultListener(LifecycleEvent.POST_PERSIST, listener, "postPersist");
         addDefaultListener(LifecycleEvent.PRE_REMOVE, listener, "preRemove");
         addDefaultListener(LifecycleEvent.POST_REMOVE, listener, "postRemove");
@@ -97,7 +97,7 @@
      * methods in this class can be used to register arbitrary listeners.
      */
     public void addListener(Class<?> entityClass, LifecycleListener listener) {
-        addListener(LifecycleEvent.PRE_ADD, entityClass, listener, "preAdd");
+        addListener(LifecycleEvent.POST_ADD, entityClass, listener, "postAdd");
         addListener(LifecycleEvent.POST_PERSIST, entityClass, listener, "postPersist");
         addListener(LifecycleEvent.PRE_REMOVE, entityClass, listener, "preRemove");
         addListener(LifecycleEvent.POST_REMOVE, entityClass, listener, "postRemove");

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/resources/org/apache/cayenne/schema/3.0/modelMap.xsd
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/resources/org/apache/cayenne/schema/3.0/modelMap.xsd?rev=821328&r1=821327&r2=821328&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/resources/org/apache/cayenne/schema/3.0/modelMap.xsd
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/resources/org/apache/cayenne/schema/3.0/modelMap.xsd
Sat Oct  3 14:31:19 2009
@@ -90,7 +90,7 @@
 				<xs:element minOccurs="0" maxOccurs="unbounded" ref="cay:entity-listener"/>
 				
 				<!--  Callbacks -->
-				<xs:element minOccurs="0" maxOccurs="unbounded" ref="cay:pre-add"/>
+				<xs:element minOccurs="0" maxOccurs="unbounded" ref="cay:post-add"/>
 				<xs:element minOccurs="0" maxOccurs="unbounded" ref="cay:pre-persist"/>
 				<xs:element minOccurs="0" maxOccurs="unbounded" ref="cay:post-persist"/>
 				<xs:element minOccurs="0" maxOccurs="unbounded" ref="cay:pre-update"/>
@@ -269,7 +269,7 @@
 	<xs:element name="entity-listener">
 		<xs:complexType>
 			<xs:sequence>
-				<xs:element minOccurs="0" maxOccurs="unbounded" ref="cay:pre-add"/>
+				<xs:element minOccurs="0" maxOccurs="unbounded" ref="cay:post-add"/>
 				<xs:element minOccurs="0" maxOccurs="unbounded" ref="cay:pre-persist"/>
 				<xs:element minOccurs="0" maxOccurs="unbounded" ref="cay:post-persist"/>
 				<xs:element minOccurs="0" maxOccurs="unbounded" ref="cay:pre-update"/>
@@ -296,7 +296,7 @@
 			<xs:attribute name="method-name" use="required" type="xs:string"/>
 		</xs:complexType>
 	</xs:element>
-	<xs:element name="pre-add">
+	<xs:element name="post-add">
 		<xs:complexType>
 			<xs:attribute name="method-name" use="required" type="xs:string"/>
 		</xs:complexType>

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/art/Artist.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/art/Artist.java?rev=821328&r1=821327&r2=821328&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/art/Artist.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/art/Artist.java
Sat Oct  3 14:31:19 2009
@@ -26,7 +26,7 @@
 
     protected transient ValidationDelegate validationDelegate;
     protected boolean validateForSaveCalled;
-    protected boolean preAdded;
+    protected boolean postAdded;
     protected boolean prePersisted;
     protected boolean preRemoved;
     protected boolean preUpdated;
@@ -52,7 +52,7 @@
     }
 
     public void resetCallbackFlags() {
-        preAdded = false;
+        postAdded = false;
         prePersisted = false;
         preRemoved = false;
         preUpdated = false;
@@ -71,8 +71,8 @@
         super.validateForSave(validationResult);
     }
 
-    public void preAddCallback() {
-        preAdded = true;
+    public void postAddCallback() {
+        postAdded = true;
     }
     
     public void prePersistCallback() {
@@ -103,8 +103,8 @@
         postLoaded++;
     }
 
-    public boolean isPreAdded() {
-        return preAdded;
+    public boolean isPostAdded() {
+        return postAdded;
     }
     
     public boolean isPrePersisted() {

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/art/Painting.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/art/Painting.java?rev=821328&r1=821327&r2=821328&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/art/Painting.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/art/Painting.java
Sat Oct  3 14:31:19 2009
@@ -24,18 +24,18 @@
 public class Painting extends org.apache.art.auto._Painting {
     protected boolean validateForSaveCalled;
 
-    protected boolean preAdded;
+    protected boolean postAdded;
     protected boolean preRemoved;
     protected boolean preUpdated;
 
     public void resetCallbackFlags() {
-        preAdded = false;
+        postAdded = false;
         preRemoved = false;
         preUpdated = false;
     }
 
-    public void preAddCallback() {
-        preAdded = true;
+    public void postAddCallback() {
+        postAdded = true;
     }
 
     public void preRemoveCallback() {
@@ -46,8 +46,8 @@
         preUpdated = true;
     }
 
-    public boolean isPreAdded() {
-        return preAdded;
+    public boolean isPostAdded() {
+        return postAdded;
     }
 
     public boolean isPreRemoved() {

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CayenneContextServerDiffsTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CayenneContextServerDiffsTest.java?rev=821328&r1=821327&r2=821328&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CayenneContextServerDiffsTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CayenneContextServerDiffsTest.java
Sat Oct  3 14:31:19 2009
@@ -47,7 +47,7 @@
         try {
 
             registry.addListener(
-                    LifecycleEvent.PRE_ADD,
+                    LifecycleEvent.POST_ADD,
                     MtTable1.class,
                     new ClientChannelServerDiffsListener1(),
                     "prePersist");
@@ -111,7 +111,7 @@
 
         try {
             registry.addListener(
-                    LifecycleEvent.PRE_ADD,
+                    LifecycleEvent.POST_ADD,
                     MtTable1.class,
                     new ClientChannelServerDiffsListener1(),
                     "prePersist");
@@ -141,7 +141,7 @@
 
         try {
             registry.addListener(
-                    LifecycleEvent.PRE_ADD,
+                    LifecycleEvent.POST_ADD,
                     MtTable1.class,
                     new ClientChannelServerDiffsListener1(),
                     "prePersistAddRelationship");

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CayenneContextWithDataContextTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CayenneContextWithDataContextTest.java?rev=821328&r1=821327&r2=821328&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CayenneContextWithDataContextTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CayenneContextWithDataContextTest.java
Sat Oct  3 14:31:19 2009
@@ -161,7 +161,7 @@
         }
     }
 
-    public void testPreAddCallback() throws Exception {
+    public void testPostAddCallback() throws Exception {
 
         ClientServerChannel csChannel = new ClientServerChannel(getDomain());
 
@@ -187,7 +187,7 @@
                 public void postUpdate(Object entity) {
                 }
 
-                public void preAdd(Object entity) {
+                public void postAdd(Object entity) {
                     flag[0] = true;
                 }
 
@@ -225,7 +225,7 @@
         }
     }
 
-    public void testPreAddOnObjectCallback() throws Exception {
+    public void testPostAddOnObjectCallback() throws Exception {
 
         TestClientServerChannel csChannel = new TestClientServerChannel(getDomain());
 
@@ -236,7 +236,7 @@
 
         try {
             callbackRegistry.addListener(
-                    LifecycleEvent.PRE_ADD,
+                    LifecycleEvent.POST_ADD,
                     MtTable1.class,
                     "prePersistMethod");
 
@@ -288,7 +288,7 @@
                 public void postUpdate(Object entity) {
                 }
 
-                public void preAdd(Object entity) {
+                public void postAdd(Object entity) {
                 }
 
                 public void preRemove(Object entity) {
@@ -345,7 +345,7 @@
                 public void postUpdate(Object entity) {
                 }
 
-                public void preAdd(Object entity) {
+                public void postAdd(Object entity) {
                 }
 
                 public void preRemove(Object entity) {

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextCallbacksTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextCallbacksTest.java?rev=821328&r1=821327&r2=821328&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextCallbacksTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextCallbacksTest.java
Sat Oct  3 14:31:19 2009
@@ -38,7 +38,7 @@
         resolver.getCallbackRegistry().clear();
     }
 
-    public void testPreAddCallbacks() {
+    public void testPostAddCallbacks() {
         LifecycleCallbackRegistry registry = getDomain()
                 .getEntityResolver()
                 .getCallbackRegistry();
@@ -48,30 +48,30 @@
         // no callbacks
         Artist a1 = context.newObject(Artist.class);
         assertNotNull(a1);
-        assertFalse(a1.isPreAdded());
+        assertFalse(a1.isPostAdded());
 
-        registry.addListener(LifecycleEvent.PRE_ADD, Artist.class, "preAddCallback");
+        registry.addListener(LifecycleEvent.POST_ADD, Artist.class, "postAddCallback");
 
         Artist a2 = context.newObject(Artist.class);
         assertNotNull(a2);
-        assertTrue(a2.isPreAdded());
+        assertTrue(a2.isPostAdded());
 
         MockCallingBackListener listener2 = new MockCallingBackListener();
         registry.addListener(
-                LifecycleEvent.PRE_ADD,
+                LifecycleEvent.POST_ADD,
                 Artist.class,
                 listener2,
                 "publicCallback");
 
         Artist a3 = context.newObject(Artist.class);
         assertNotNull(a3);
-        assertTrue(a3.isPreAdded());
+        assertTrue(a3.isPostAdded());
 
         assertSame(a3, listener2.getPublicCalledbackEntity());
 
         Painting p3 = context.newObject(Painting.class);
         assertNotNull(p3);
-        assertFalse(p3.isPreAdded());
+        assertFalse(p3.isPostAdded());
         assertSame(a3, listener2.getPublicCalledbackEntity());
     }
 
@@ -126,7 +126,7 @@
         a1.setArtistName("XX");
         context.commitChanges();
         context.deleteObject(a1);
-        assertFalse(a1.isPreAdded());
+        assertFalse(a1.isPostAdded());
         assertFalse(a1.isPreRemoved());
 
         registry
@@ -136,7 +136,7 @@
         a2.setArtistName("XX");
         context.commitChanges();
         context.deleteObject(a2);
-        assertFalse(a2.isPreAdded());
+        assertFalse(a2.isPostAdded());
         assertTrue(a2.isPreRemoved());
 
         MockCallingBackListener listener2 = new MockCallingBackListener();
@@ -150,7 +150,7 @@
         a3.setArtistName("XX");
         context.commitChanges();
         context.deleteObject(a3);
-        assertFalse(a3.isPreAdded());
+        assertFalse(a3.isPostAdded());
         assertTrue(a3.isPreRemoved());
 
         assertSame(a3, listener2.getPublicCalledbackEntity());
@@ -159,7 +159,7 @@
         p3.setPaintingTitle("XX");
         context.commitChanges();
         context.deleteObject(p3);
-        assertFalse(p3.isPreAdded());
+        assertFalse(p3.isPostAdded());
         assertFalse(p3.isPreRemoved());
         assertSame(a3, listener2.getPublicCalledbackEntity());
     }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/map/CallbackDescriptorTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/map/CallbackDescriptorTest.java?rev=821328&r1=821327&r2=821328&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/map/CallbackDescriptorTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/map/CallbackDescriptorTest.java
Sat Oct  3 14:31:19 2009
@@ -28,7 +28,7 @@
     }
 
     public void testAddCallbackMethod() {
-        CallbackDescriptor m = new CallbackDescriptor(LifecycleEvent.PRE_ADD);
+        CallbackDescriptor m = new CallbackDescriptor(LifecycleEvent.POST_ADD);
         assertEquals(0, m.getCallbackMethods().size());
         m.addCallbackMethod("a");
         assertEquals(1, m.getCallbackMethods().size());

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/remote/ClientChannelServerDiffsTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/remote/ClientChannelServerDiffsTest.java?rev=821328&r1=821327&r2=821328&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/remote/ClientChannelServerDiffsTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/remote/ClientChannelServerDiffsTest.java
Sat Oct  3 14:31:19 2009
@@ -116,7 +116,7 @@
         try {
 
             registry.addListener(
-                    LifecycleEvent.PRE_ADD,
+                    LifecycleEvent.POST_ADD,
                     MtTable1.class,
                     new ClientChannelServerDiffsListener1(),
                     "prePersist");

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/resources/locking.map.xml
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/resources/locking.map.xml?rev=821328&r1=821327&r2=821328&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/resources/locking.map.xml
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/resources/locking.map.xml
Sat Oct  3 14:31:19 2009
@@ -52,7 +52,7 @@
 	<obj-entity name="SoftTest" className="org.apache.cayenne.testdo.locking.SoftTest" dbEntityName="SOFT_TEST">
 		<obj-attribute name="deleted" type="java.lang.Boolean" db-attribute-path="DELETED"/>
 		<obj-attribute name="name" type="java.lang.String" db-attribute-path="NAME"/>
-		<pre-add method-name="onPrePersist"/>
+		<post-add method-name="onPrePersist"/>
 	</obj-entity>
 	<obj-entity name="TimeLockingTestEntity" className="org.apache.cayenne.testdo.locking.TimeLockingTestEntity"
lock-type="optimistic" dbEntityName="TIME_LOCKING_TEST">
 		<obj-attribute name="name" type="java.lang.String" db-attribute-path="NAME"/>

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/resources/testmap.map.xml
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/resources/testmap.map.xml?rev=821328&r1=821327&r2=821328&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/resources/testmap.map.xml
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/resources/testmap.map.xml
Sat Oct  3 14:31:19 2009
@@ -255,7 +255,7 @@
 		<obj-attribute name="artistName" type="java.lang.String"/>
 		<obj-attribute name="dateOfBirth" type="java.util.Date"/>
 		<entity-listener class="org.apache.art.EntityListenerObjEntity">
-			<pre-add method-name="prePersistEntityListener"/>
+			<post-add method-name="prePersistEntityListener"/>
 			<post-persist method-name="postPersistEntityListener"/>
 			<pre-update method-name="preUpdateEntityListener"/>
 			<post-update method-name="postUpdateEntityListener"/>
@@ -263,7 +263,7 @@
 			<post-remove method-name="postRemoveEntityListener"/>
 			<post-load method-name="postLoadEntityListener"/>
 		</entity-listener>
-		<pre-add method-name="prePersistEntityObjEntity"/>
+		<post-add method-name="prePersistEntityObjEntity"/>
 		<post-persist method-name="postPersistEntityObjEntity"/>
 		<pre-update method-name="preUpdateEntityObjEntity"/>
 		<post-update method-name="postUpdateEntityObjEntity"/>
@@ -644,8 +644,8 @@
 		<sql><![CDATA[select * from ARTIST]]></sql>
 	</query>
 	<entity-listener class="org.apache.art.EntityListenerDataMap">
-		<pre-add method-name="prePersistDataMap1"/>
-		<pre-add method-name="prePersistDataMap2"/>
+		<post-add method-name="prePersistDataMap1"/>
+		<post-add method-name="prePersistDataMap2"/>
 		<post-persist method-name="postPersistDataMap"/>
 		<pre-update method-name="preUpdateDataMap"/>
 		<post-update method-name="postUpdateDataMap"/>

Modified: cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/bridge/DataMapConverter.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/bridge/DataMapConverter.java?rev=821328&r1=821327&r2=821328&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/bridge/DataMapConverter.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/bridge/DataMapConverter.java
Sat Oct  3 14:31:19 2009
@@ -244,7 +244,7 @@
         }
 
         if (jpaListener.getPrePersist() != null) {
-            listener.getCallbackMap().getPreAdd().addCallbackMethod(
+            listener.getCallbackMap().getPostAdd().addCallbackMethod(
                     jpaListener.getPrePersist().getMethodName());
         }
 
@@ -763,7 +763,7 @@
             }
 
             if (jpaEntity.getPrePersist() != null) {
-                cayenneEntity.getCallbackMap().getPreAdd().addCallbackMethod(
+                cayenneEntity.getCallbackMap().getPostAdd().addCallbackMethod(
                         jpaEntity.getPrePersist().getMethodName());
             }
 

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/AbstractCallbackMethodsTab.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/AbstractCallbackMethodsTab.java?rev=821328&r1=821327&r2=821328&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/AbstractCallbackMethodsTab.java
(original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/AbstractCallbackMethodsTab.java
Sat Oct  3 14:31:19 2009
@@ -85,7 +85,7 @@
      */
     protected JComboBox callbackTypeCombo = CayenneWidgetFactory.createComboBox(
             new Object[] {
-                    new CallbackType(LifecycleEvent.PRE_ADD, "pre-add"),
+                    new CallbackType(LifecycleEvent.POST_ADD, "post-add"),
                     new CallbackType(LifecycleEvent.PRE_PERSIST, "pre-persist"),
                     new CallbackType(LifecycleEvent.POST_PERSIST, "post-persist"),
                     new CallbackType(LifecycleEvent.PRE_UPDATE, "pre-update"),

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/resources/pref/ModelerPreferences.map.xml
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/resources/pref/ModelerPreferences.map.xml?rev=821328&r1=821327&r2=821328&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/resources/pref/ModelerPreferences.map.xml
(original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/resources/pref/ModelerPreferences.map.xml
Sat Oct  3 14:31:19 2009
@@ -66,7 +66,7 @@
 		<obj-attribute name="createTables" type="java.lang.Boolean" db-attribute-path="create_tables"/>
 		<obj-attribute name="dropPK" type="java.lang.Boolean" db-attribute-path="drop_pk"/>
 		<obj-attribute name="dropTables" type="java.lang.Boolean" db-attribute-path="drop_tables"/>
-		<pre-add method-name="prePersist"/>
+		<post-add method-name="prePersist"/>
 	</obj-entity>
 	<obj-entity name="DataMapDefaults" className="org.apache.cayenne.modeler.pref.DataMapDefaults"
lock-type="optimistic" dbEntityName="data_map_defaults" superClassName="org.apache.cayenne.pref.PreferenceDetail">
 		<obj-attribute name="generatePairs" type="java.lang.Boolean" db-attribute-path="generate_pairs"/>
@@ -74,7 +74,7 @@
 		<obj-attribute name="subclassTemplate" type="java.lang.String" db-attribute-path="subclass_template"/>
 		<obj-attribute name="superclassPackage" type="java.lang.String" db-attribute-path="superclass_package_suffix"/>
 		<obj-attribute name="superclassTemplate" type="java.lang.String" db-attribute-path="superclass_template"/>
-		<pre-add method-name="prePersist"/>
+		<post-add method-name="prePersist"/>
 	</obj-entity>
 	<obj-entity name="DataNodeDefaults" className="org.apache.cayenne.modeler.pref.DataNodeDefaults"
lock-type="optimistic" dbEntityName="data_node_defaults" superClassName="org.apache.cayenne.pref.PreferenceDetail">
 		<obj-attribute name="localDataSource" type="java.lang.String" db-attribute-path="local_data_source"/>



Mime
View raw message