openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hthom...@apache.org
Subject svn commit: r1428664 - in /openjpa/branches/2.0.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 23:13:46 GMT
Author: hthomann
Date: Thu Jan  3 23:13:45 2013
New Revision: 1428664

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

Modified:
    openjpa/branches/2.0.x/   (props changed)
    openjpa/branches/2.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/EDeletedState.java
    openjpa/branches/2.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PDeletedState.java
    openjpa/branches/2.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNewDeletedState.java
    openjpa/branches/2.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNewFlushedDeletedState.java
    openjpa/branches/2.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java
    openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/TestTransition2.java

Propchange: openjpa/branches/2.0.x/
------------------------------------------------------------------------------
  Merged /openjpa/branches/1.2.x:r1428496

Modified: openjpa/branches/2.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/EDeletedState.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/EDeletedState.java?rev=1428664&r1=1428663&r2=1428664&view=diff
==============================================================================
--- openjpa/branches/2.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/EDeletedState.java
(original)
+++ openjpa/branches/2.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/EDeletedState.java
Thu Jan  3 23:13:45 2013
@@ -30,12 +30,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/2.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PDeletedState.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PDeletedState.java?rev=1428664&r1=1428663&r2=1428664&view=diff
==============================================================================
--- openjpa/branches/2.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PDeletedState.java
(original)
+++ openjpa/branches/2.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PDeletedState.java
Thu Jan  3 23:13:45 2013
@@ -38,12 +38,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/2.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNewDeletedState.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNewDeletedState.java?rev=1428664&r1=1428663&r2=1428664&view=diff
==============================================================================
--- openjpa/branches/2.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNewDeletedState.java
(original)
+++ openjpa/branches/2.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNewDeletedState.java
Thu Jan  3 23:13:45 2013
@@ -30,12 +30,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/2.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNewFlushedDeletedState.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNewFlushedDeletedState.java?rev=1428664&r1=1428663&r2=1428664&view=diff
==============================================================================
--- openjpa/branches/2.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNewFlushedDeletedState.java
(original)
+++ openjpa/branches/2.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNewFlushedDeletedState.java
Thu Jan  3 23:13:45 2013
@@ -34,12 +34,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/2.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java?rev=1428664&r1=1428663&r2=1428664&view=diff
==============================================================================
--- openjpa/branches/2.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java
(original)
+++ openjpa/branches/2.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java
Thu Jan  3 23:13:45 2013
@@ -2771,8 +2771,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/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/TestTransition2.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/TestTransition2.java?rev=1428664&r1=1428663&r2=1428664&view=diff
==============================================================================
--- openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/TestTransition2.java
(original)
+++ openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/TestTransition2.java
Thu Jan  3 23:13:45 2013
@@ -519,9 +519,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());
     }
 
     /**
@@ -644,9 +644,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