openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From awh...@apache.org
Subject svn commit: r428193 - /incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreManager.java
Date Wed, 02 Aug 2006 23:37:03 GMT
Author: awhite
Date: Wed Aug  2 16:37:02 2006
New Revision: 428193

URL: http://svn.apache.org/viewvc?rev=428193&view=rev
Log:
Fixes to optimization logic for including joined subclass data in initial 
SELECT.


Modified:
    incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreManager.java

Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreManager.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreManager.java?rev=428193&r1=428192&r2=428193&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreManager.java
(original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreManager.java
Wed Aug  2 16:37:02 2006
@@ -1078,7 +1078,8 @@
      */
     private boolean optSelect(FieldMapping fm, Select sel,
         OpenJPAStateManager sm, JDBCFetchConfiguration fetch) {
-        return !fm.isDefaultFetchGroupExplicit()
+        return !fm.isInDefaultFetchGroup() 
+            && !fm.isDefaultFetchGroupExplicit()
             && (sm == null || sm.getPCState() == PCState.TRANSIENT 
             || !sm.getLoaded().get(fm.getIndex()))
             && fm.supportsSelect(sel, sel.TYPE_TWO_PART, sm, this, fetch) > 0;
@@ -1121,9 +1122,11 @@
             fms = subMappings[i].getDefinedFieldMappings();
             for (int j = 0; j < fms.length; j++) {
                 // make sure in one of configured fetch groups
-            	if (fetch.requiresFetch(fms[j]) 
-            	  || fms[j].supportsSelect(sel, sel.TYPE_TWO_PART, sm, this, 
-                    fetch) <= 0) 
+            	if (!fetch.requiresFetch(fms[j]) 
+                    && ((!fms[j].isInDefaultFetchGroup() 
+                    && fms[j].isDefaultFetchGroupExplicit())
+                    || fms[j].supportsSelect(sel, sel.TYPE_TWO_PART, sm, this, 
+                    fetch) <= 0)) 
             		continue;
 
                 // if we can join to the subclass, do so; much better chance
@@ -1137,10 +1140,9 @@
 
                 // if can select with tables already selected, do it
                 if (fms[j].supportsSelect(sel, sel.TYPE_JOINLESS, sm, this,
-                    fetch) > 0 && fetch.requiresFetch(fms[j])) {
-                    fms[j].select(sel, null, this, fetch.traverseJDBC (fms[j]),
+                    fetch) > 0)
+                    fms[j].select(sel, null, this, fetch.traverseJDBC(fms[j]),
                         fetch.EAGER_NONE);
-                }
             }
         }
     }



Mime
View raw message