openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hthom...@apache.org
Subject svn commit: r1673513 - in /openjpa/trunk: ./ openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/ openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/multiselect/
Date Tue, 14 Apr 2015 18:59:30 GMT
Author: hthomann
Date: Tue Apr 14 18:59:29 2015
New Revision: 1673513

URL: http://svn.apache.org/r1673513
Log:
OPENJPA-2571: Criteria Builder query generates extra alias when using multiselect.

Added:
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/multiselect/
      - copied from r1673300, openjpa/branches/2.1.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/multiselect/
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/multiselect/DimDay.java
      - copied unchanged from r1673300, openjpa/branches/2.1.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/multiselect/DimDay.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/multiselect/DimDay_.java
      - copied unchanged from r1673300, openjpa/branches/2.1.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/multiselect/DimDay_.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/multiselect/FactWorkAssignment.java
      - copied unchanged from r1673300, openjpa/branches/2.1.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/multiselect/FactWorkAssignment.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/multiselect/FactWorkAssignment_.java
      - copied unchanged from r1673300, openjpa/branches/2.1.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/multiselect/FactWorkAssignment_.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/multiselect/TestCriteriaMultiselectAliasing.java
      - copied unchanged from r1673300, openjpa/branches/2.1.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/multiselect/TestCriteriaMultiselectAliasing.java
Modified:
    openjpa/trunk/   (props changed)
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java

Propchange: openjpa/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Apr 14 18:59:29 2015
@@ -1,6 +1,6 @@
 /openjpa/branches/1.0.x:736493
 /openjpa/branches/2.0.x:1504611
-/openjpa/branches/2.1.x:1415379,1415398,1485010,1513249,1517838,1530146,1533218,1533280,1539188,1569528,1575444,1591536,1636464,1655218,1662610,1673491
+/openjpa/branches/2.1.x:1415379,1415398,1485010,1513249,1517838,1530146,1533218,1533280,1539188,1569528,1575444,1591536,1636464,1655218,1662610,1673300,1673491
 /openjpa/branches/2.2.1.x:1415367,1415413,1415425,1504719,1508186,1530347,1533222,1539193,1651808
 /openjpa/branches/2.2.x:1384400,1415459-1415460,1415469,1485013,1530364,1533223,1580898,1580939,1591681,1631786,1641906,1666312
 /openjpa/branches/2.3.x:1533462,1535560,1536912,1540277,1564121

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java?rev=1673513&r1=1673512&r2=1673513&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java Tue
Apr 14 18:59:29 2015
@@ -2896,7 +2896,20 @@ public class SelectImpl
                 if (this.var != null) {
                     this.append(this.var);
                 } else if (this.path == null && this.correlatedVar != null &&
_sel._dict.isImplicitJoin()) {
-                    this.append(this.correlatedVar);
+                    String str = this.var;
+                    for(Object o : _sel._parent._aliases.keySet()){
+                        if (o instanceof Key) {
+                            Key k = (Key) o;
+                            if (this.correlatedVar.equals(k._path)) {
+                                str = this.correlatedVar;
+                                break;
+                            }
+                        }else if (o.equals(this.correlatedVar)){
+                            str = this.correlatedVar;
+                            break;
+                        }
+                    }
+                    this.append(str);
                 }
                 this.var = null;
                 _outer = false;



Mime
View raw message