openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fayw...@apache.org
Subject svn commit: r801052 - in /openjpa/trunk: openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/
Date Wed, 05 Aug 2009 02:56:41 GMT
Author: faywang
Date: Wed Aug  5 02:56:41 2009
New Revision: 801052

URL: http://svn.apache.org/viewvc?rev=801052&view=rev
Log:
OPENJPA-1226: fix merge entities with nested embeddables

Modified:
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachedStateManager.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/VersionAttachStrategy.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/TestEmbeddable.java

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachedStateManager.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachedStateManager.java?rev=801052&r1=801051&r2=801052&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachedStateManager.java
(original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachedStateManager.java
Wed Aug  5 02:56:41 2009
@@ -118,7 +118,7 @@
 
         // pre-load for efficiency: current field values for restore, dependent
         // for delete
-        FieldMetaData[] fields = meta.getFields();
+        FieldMetaData[] fields = sm.getMetaData().getFields(); 
         int restore = broker.getRestoreState();
         if (_dirty.length() > 0) {
             BitSet load = new BitSet(fields.length);

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/VersionAttachStrategy.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/VersionAttachStrategy.java?rev=801052&r1=801051&r2=801052&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/VersionAttachStrategy.java
(original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/VersionAttachStrategy.java
Wed Aug  5 02:56:41 2009
@@ -146,7 +146,7 @@
         int detach = (isNew) ? DETACH_ALL : broker.getDetachState();
         FetchConfiguration fetch = broker.getFetchConfiguration();
         try {
-            FieldMetaData[] fmds = meta.getFields();
+            FieldMetaData[] fmds = sm.getMetaData().getFields(); 
             for (int i = 0; i < fmds.length; i++) {
                 switch (detach) {
                     case DETACH_ALL:

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/TestEmbeddable.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/TestEmbeddable.java?rev=801052&r1=801051&r2=801052&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/TestEmbeddable.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/TestEmbeddable.java
Wed Aug  5 02:56:41 2009
@@ -897,6 +897,13 @@
         EntityA_Coll_Embed_Embed a =
             em.find(EntityA_Coll_Embed_Embed.class, ID);
         checkEntityA_Coll_Embed_Embed(a);
+        
+        em.clear();
+        em.getTransaction().begin();
+        Embed_Embed embed = createEmbed_Embed(em, ID, 100);
+        a.addEmbed(embed);
+        em.merge(a);
+        em.getTransaction().commit();
         em.close();
     }
 



Mime
View raw message