cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r404806 - in /incubator/cayenne/main/trunk/cayenne/cayenne-java/src: cayenne/java/org/objectstyle/cayenne/access/ tests/java/org/objectstyle/cayenne/access/ tests/resources/dml/
Date Sun, 07 May 2006 17:42:37 GMT
Author: aadamchik
Date: Sun May  7 10:42:35 2006
New Revision: 404806

URL: http://svn.apache.org/viewcvs?rev=404806&view=rev
Log:
CAY-544

Modified:
    incubator/cayenne/main/trunk/cayenne/cayenne-java/src/cayenne/java/org/objectstyle/cayenne/access/ObjectDiff.java
    incubator/cayenne/main/trunk/cayenne/cayenne-java/src/cayenne/java/org/objectstyle/cayenne/access/ObjectStore.java
    incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/objectstyle/cayenne/access/DataContextExtrasTst.java
    incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/resources/dml/access.DataContextExtrasTst.xml

Modified: incubator/cayenne/main/trunk/cayenne/cayenne-java/src/cayenne/java/org/objectstyle/cayenne/access/ObjectDiff.java
URL: http://svn.apache.org/viewcvs/incubator/cayenne/main/trunk/cayenne/cayenne-java/src/cayenne/java/org/objectstyle/cayenne/access/ObjectDiff.java?rev=404806&r1=404805&r2=404806&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/cayenne/cayenne-java/src/cayenne/java/org/objectstyle/cayenne/access/ObjectDiff.java
(original)
+++ incubator/cayenne/main/trunk/cayenne/cayenne-java/src/cayenne/java/org/objectstyle/cayenne/access/ObjectDiff.java
Sun May  7 10:42:35 2006
@@ -50,10 +50,6 @@
                 || state == PersistenceState.DELETED
                 || state == PersistenceState.MODIFIED) {
 
-            ObjEntity entity = objectStore.getContext().getEntityResolver().getObjEntity(
-                    object.getObjectId().getEntityName());
-            final boolean lock = entity.getLockType() == ObjEntity.LOCK_TYPE_OPTIMISTIC;
-
             this.snapshot = new HashMap();
             this.arcSnapshot = new HashMap();
 
@@ -69,10 +65,7 @@
                 }
 
                 public boolean visitSingleObjectArc(SingleObjectArcProperty property) {
-                    if (lock) {
-                        takeSingleObjectArcSnapshot(property, object);
-                    }
-
+                    takeSingleObjectArcSnapshot(property, object);
                     return true;
                 }
             });

Modified: incubator/cayenne/main/trunk/cayenne/cayenne-java/src/cayenne/java/org/objectstyle/cayenne/access/ObjectStore.java
URL: http://svn.apache.org/viewcvs/incubator/cayenne/main/trunk/cayenne/cayenne-java/src/cayenne/java/org/objectstyle/cayenne/access/ObjectStore.java?rev=404806&r1=404805&r2=404806&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/cayenne/cayenne-java/src/cayenne/java/org/objectstyle/cayenne/access/ObjectStore.java
(original)
+++ incubator/cayenne/main/trunk/cayenne/cayenne-java/src/cayenne/java/org/objectstyle/cayenne/access/ObjectStore.java
Sun May  7 10:42:35 2006
@@ -237,7 +237,6 @@
             objectDiff = new ObjectDiff(this, object);
             objectDiff.setDiffId(++currentDiffId);
             changes.put(id, objectDiff);
-
         }
 
         if (diff != null) {

Modified: incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/objectstyle/cayenne/access/DataContextExtrasTst.java
URL: http://svn.apache.org/viewcvs/incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/objectstyle/cayenne/access/DataContextExtrasTst.java?rev=404806&r1=404805&r2=404806&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/objectstyle/cayenne/access/DataContextExtrasTst.java
(original)
+++ incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/objectstyle/cayenne/access/DataContextExtrasTst.java
Sun May  7 10:42:35 2006
@@ -322,6 +322,21 @@
         assertFalse(a1.isValidateForSaveCalled());
     }
 
+    public void testPhantomModificationsValidate2() throws Exception {
+        deleteTestData();
+        createTestData("testPhantomModification2");
+        DataContext context = createDataContext();
+
+        List objects = context.performQuery(new SelectQuery(Painting.class));
+        Painting p1 = (Painting) objects.get(0);
+
+        p1.setPaintingTitle(p1.getPaintingTitle());
+        p1.resetValidationFlags();
+        context.commitChanges();
+
+        assertFalse(p1.isValidateForSaveCalled());
+    }
+
     public void testPhantomAttributeModificationCommit() throws Exception {
         deleteTestData();
         createTestData("testPhantomModification");

Modified: incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/resources/dml/access.DataContextExtrasTst.xml
URL: http://svn.apache.org/viewcvs/incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/resources/dml/access.DataContextExtrasTst.xml?rev=404806&r1=404805&r2=404806&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/resources/dml/access.DataContextExtrasTst.xml
(original)
+++ incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/resources/dml/access.DataContextExtrasTst.xml
Sun May  7 10:42:35 2006
@@ -38,6 +38,15 @@
 			</list>
 		</constructor-arg>
 	</bean>
+		<bean id="testPhantomModification2" class="java.util.ArrayList">
+		<constructor-arg>
+			<list>
+				<ref bean="A1"/>
+				<ref bean="A2"/>
+				<ref bean="P11"/>
+			</list>
+		</constructor-arg>
+	</bean>
 	<bean id="testPhantomRelationshipModificationCommit" class="java.util.ArrayList">
 		<constructor-arg>
 			<list>



Mime
View raw message