openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hthom...@apache.org
Subject svn commit: r1428496 - in /openjpa/branches/1.2.x: openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/
Date Thu, 03 Jan 2013 17:33:18 GMT
Author: hthomann
Date: Thu Jan  3 17:33:18 2013
New Revision: 1428496

URL: http://svn.apache.org/viewvc?rev=1428496&view=rev
Log:
OPENJPA-1644: Null field values after calling EntityManager.remove() - back ported to 1.2.x
Rick's changes from trunk.

Modified:
    openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/EDeletedState.java
    openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PDeletedState.java
    openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNewDeletedState.java
    openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNewFlushedDeletedState.java
    openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java
    openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/TestTransition2.java

Modified: openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/EDeletedState.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/EDeletedState.java?rev=1428496&r1=1428495&r2=1428496&view=diff
==============================================================================
--- openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/EDeletedState.java
(original)
+++ openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/EDeletedState.java
Thu Jan  3 17:33:18 2013
@@ -29,12 +29,12 @@ class EDeletedState
     extends PCState {
 
     PCState commit(StateManagerImpl context) {
-        context.clearFields();
+//        context.clearFields();
         return TRANSIENT;
     }
 
     PCState commitRetain(StateManagerImpl context) {
-        context.clearFields();
+//        context.clearFields();
         return TRANSIENT;
     }
 

Modified: openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PDeletedState.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PDeletedState.java?rev=1428496&r1=1428495&r2=1428496&view=diff
==============================================================================
--- openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PDeletedState.java
(original)
+++ openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PDeletedState.java
Thu Jan  3 17:33:18 2013
@@ -37,12 +37,12 @@ class PDeletedState
     }
 
     PCState commit(StateManagerImpl context) {
-        context.clearFields();
+//        context.clearFields();
         return TRANSIENT;
     }
 
     PCState commitRetain(StateManagerImpl context) {
-        context.clearFields();
+//        context.clearFields();
         return TRANSIENT;
     }
 

Modified: openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNewDeletedState.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNewDeletedState.java?rev=1428496&r1=1428495&r2=1428496&view=diff
==============================================================================
--- openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNewDeletedState.java
(original)
+++ openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNewDeletedState.java
Thu Jan  3 17:33:18 2013
@@ -29,12 +29,12 @@ class PNewDeletedState
     extends PCState {
 
     PCState commit(StateManagerImpl context) {
-        context.clearFields();
+//        context.clearFields();
         return TRANSIENT;
     }
 
     PCState commitRetain(StateManagerImpl context) {
-        context.clearFields();
+//        context.clearFields();
         return TRANSIENT;
     }
 

Modified: openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNewFlushedDeletedState.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNewFlushedDeletedState.java?rev=1428496&r1=1428495&r2=1428496&view=diff
==============================================================================
--- openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNewFlushedDeletedState.java
(original)
+++ openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNewFlushedDeletedState.java
Thu Jan  3 17:33:18 2013
@@ -33,12 +33,12 @@ class PNewFlushedDeletedState
     }
 
     PCState commit(StateManagerImpl context) {
-        context.clearFields();
+//        context.clearFields();
         return TRANSIENT;
     }
 
     PCState commitRetain(StateManagerImpl context) {
-        context.clearFields();
+//        context.clearFields();
         return TRANSIENT;
     }
 

Modified: openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java?rev=1428496&r1=1428495&r2=1428496&view=diff
==============================================================================
--- openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java
(original)
+++ openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java
Thu Jan  3 17:33:18 2013
@@ -2646,8 +2646,7 @@ public class StateManagerImpl
             // clear non-pk fields
             FieldMetaData[] fmds = _meta.getFields();
             for (int i = 0; i < fmds.length; i++) {
-                if (!fmds[i].isPrimaryKey() && fmds[i].getManagement()
-                    == FieldMetaData.MANAGE_PERSISTENT)
+            	if (!fmds[i].isPrimaryKey() && fmds[i].getManagement() == FieldMetaData.MANAGE_PERSISTENT)
                     replaceField(_pc, ClearFieldManager.getInstance(), i);
             }
 

Modified: openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/TestTransition2.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/TestTransition2.java?rev=1428496&r1=1428495&r2=1428496&view=diff
==============================================================================
--- openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/TestTransition2.java
(original)
+++ openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/TestTransition2.java
Thu Jan  3 17:33:18 2013
@@ -532,9 +532,9 @@ public class TestTransition2 extends Bas
         assertEquals("PARENT", parent.getStringField());
 
         // 'b' should be cleared
-        assertNull(b.getStringField());
-        assertEquals(0, b.getIntField());
-        assertNull(b.getSelfOneOne());
+        assertNotNull(b.getStringField());
+        assertNotEquals(0, b.getIntField());
+        assertNotNull(b.getSelfOneOne());
     }
 
     /**
@@ -661,9 +661,9 @@ public class TestTransition2 extends Bas
         assertEquals("PARENT", parent.getStringField());
 
         // 'b' should be cleared
-        assertNull(b.getStringField());
-        assertEquals(0, b.getIntField());
-        assertNull(b.getSelfOneOne());
+        assertNotNull(b.getStringField());
+        assertNotEquals(0, b.getIntField());
+        assertNotNull(b.getSelfOneOne());
     }
 
     /**



Mime
View raw message