openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From awh...@apache.org
Subject svn commit: r449105 - in /incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc: kernel/exps/PCPath.java kernel/exps/SelectConstructor.java kernel/exps/Val.java sql/SelectImpl.java
Date Fri, 22 Sep 2006 22:06:07 GMT
Author: awhite
Date: Fri Sep 22 15:06:06 2006
New Revision: 449105

URL: http://svn.apache.org/viewvc?view=rev&rev=449105
Log:
When selecting a relation field as a projection, outer join across the relation
even if forceOuter on the original path is false.


Modified:
    incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/PCPath.java
    incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/SelectConstructor.java
    incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/Val.java
    incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java

Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/PCPath.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/PCPath.java?view=diff&rev=449105&r1=449104&r2=449105
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/PCPath.java
(original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/PCPath.java
Fri Sep 22 15:06:06 2006
@@ -415,7 +415,8 @@
             traverseField(pstate, key, forceOuter, true);
         pstate.joinedRel = false;
         if ((flags & JOIN_REL) != 0)
-            joinRelation(pstate, key, forceOuter, false);
+            joinRelation(pstate, key, forceOuter || (flags & FORCE_OUTER) != 0,
+                false);
         return pstate;
     }
 

Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/SelectConstructor.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/SelectConstructor.java?view=diff&rev=449105&r1=449104&r2=449105
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/SelectConstructor.java
(original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/SelectConstructor.java
Fri Sep 22 15:06:06 2006
@@ -194,7 +194,7 @@
                 // have to join through to related type for pc object 
                 // projections; this ensures that we have all our joins cached
                 state.projections[i] = resultVal.initialize(sel, ctx, 
-                    Val.JOIN_REL);
+                    Val.JOIN_REL | Val.FORCE_OUTER);
                 joins = sel.and(joins, state.projections[i].joins);
             }
         }

Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/Val.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/Val.java?view=diff&rev=449105&r1=449104&r2=449105
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/Val.java
(original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/Val.java
Fri Sep 22 15:06:06 2006
@@ -38,12 +38,18 @@
     /**
      * Initialization flag indicating that this value will be compared to null.
      */
-    public final int NULL_CMP = 1;
+    public final int NULL_CMP = 2 << 0;
 
     /**
      * Initialization flag indicating to join into any relation path.
      */
-    public final int JOIN_REL = 2; 
+    public final int JOIN_REL = 2 << 1; 
+
+    /**
+     * Initialization flag indicating to force an outer join into any relation 
+     * path.
+     */
+    public final int FORCE_OUTER = 2 << 2; 
 
     /**
      * Initialize the value. This method should recursively initialize any

Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java?view=diff&rev=449105&r1=449104&r2=449105
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java
(original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java
Fri Sep 22 15:06:06 2006
@@ -2258,8 +2258,7 @@
                     return FROM_SELECT_ALIAS + "." + alias + "_" + col;
                 return alias + "_" + col;
             }
-            alias = _sel.toAlias(_sel.getTableIndex(col.getTable(), pj,
-                false));
+            alias = _sel.toAlias(_sel.getTableIndex(col.getTable(), pj, false));
             return (alias == null) ? null : alias + "." + col;
         }
 



Mime
View raw message