openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p..@apache.org
Subject svn commit: r650633 - /openjpa/branches/1.1.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/EmbedFieldStrategy.java
Date Tue, 22 Apr 2008 20:09:31 GMT
Author: pcl
Date: Tue Apr 22 13:09:28 2008
New Revision: 650633

URL: http://svn.apache.org/viewvc?rev=650633&view=rev
Log:
OPENJPA-576. Reverting Sandeep's change pending an updated change from him.

Modified:
    openjpa/branches/1.1.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/EmbedFieldStrategy.java

Modified: openjpa/branches/1.1.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/EmbedFieldStrategy.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.1.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/EmbedFieldStrategy.java?rev=650633&r1=650632&r2=650633&view=diff
==============================================================================
--- openjpa/branches/1.1.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/EmbedFieldStrategy.java
(original)
+++ openjpa/branches/1.1.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/EmbedFieldStrategy.java
Tue Apr 22 13:09:28 2008
@@ -405,13 +405,6 @@
             return;
         }
 
-        if (fetch.requiresFetch(field.getFieldMetaData()) 
-            != JDBCFetchConfiguration.FETCH_LOAD) {
-          return;
-        } else {
-          fetch = fetch.traverseJDBC(field.getFieldMetaData());
-        }
-        
         //### note: without a null indicator column, the above indicatesNull()
         //### call will always return false, meaning we always have to assume
         //### we selected the embedded object fields and load the object
@@ -424,7 +417,7 @@
 
         FieldMapping[] fields = field.getEmbeddedMapping().getFieldMappings();
         Object eres, processed;
-        boolean loaded = true;
+        boolean loaded = false;
         for (int i = 0; i < fields.length; i++) {
             eres = res.getEager(fields[i]);
             res.startDataRequest(fields[i]);
@@ -436,24 +429,18 @@
                         fields[i].loadEagerParallel(em, store, fetch, eres);
                     if (processed != eres)
                         res.putEager(fields[i], processed);
-                } else {
+                } else
                     fields[i].load(em, store, fetch, res);
-                }
-                FieldMetaData fm = fields[i].getFieldMetaData();
-                loaded &= em.getLoaded().get(i) || 
-                    (fm != null && fetch.requiresFetch(fm)
-                        != FetchConfiguration.FETCH_LOAD);
+                loaded |= em.getLoaded().get(i);
             } finally {
                 res.endDataRequest();
             }
         }
 
-        // After loading everything from result, load the rest of the
-        // configured fields if anything is missing.
-        if (!loaded) {
-          em.load(fetch);
-        }
-        
+        // after loading everything from result, load the rest of the
+        // configured fields
+        if (loaded)
+            em.load(fetch);
     }
 
     /**



Mime
View raw message