openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hthom...@apache.org
Subject svn commit: r1673503 - in /openjpa/branches/2.2.x: ./ 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:44:06 GMT
Author: hthomann
Date: Tue Apr 14 18:44:06 2015
New Revision: 1673503

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

Added:
    openjpa/branches/2.2.x/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/branches/2.2.x/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/branches/2.2.x/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/branches/2.2.x/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/branches/2.2.x/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/branches/2.2.x/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/branches/2.2.x/   (props changed)
    openjpa/branches/2.2.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java

Propchange: openjpa/branches/2.2.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Apr 14 18:44:06 2015
@@ -1,5 +1,5 @@
 /openjpa/branches/1.0.x:736493
 /openjpa/branches/2.0.x:1484136,1484287,1504611
-/openjpa/branches/2.1.x:1415379,1415398,1469090,1469949,1484300,1484313,1485010,1505837,1513249,1517838,1529241,1530146,1533218,1533280,1539188,1569528,1575444,1591536,1614935,1636464,1648430,1655218,1662610,1673491
+/openjpa/branches/2.1.x:1415379,1415398,1469090,1469949,1484300,1484313,1485010,1505837,1513249,1517838,1529241,1530146,1533218,1533280,1539188,1569528,1575444,1591536,1614935,1636464,1648430,1655218,1662610,1673300,1673491
 /openjpa/branches/2.2.1.x:1415367,1415413,1415425,1469408,1470097,1484320,1484322,1491895,1504719,1529267,1529340,1530347,1531176,1533222,1539193,1584153,1648450,1651808
 /openjpa/trunk:1416742,1420324,1430117,1431649,1436957,1436960,1448662,1448796,1451369,1456574,1456614,1459091,1461833,1469646,1469649,1469652,1504282,1600682,1600757,1603251,1626287,1632647

Modified: openjpa/branches/2.2.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.2.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java?rev=1673503&r1=1673502&r2=1673503&view=diff
==============================================================================
--- openjpa/branches/2.2.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java
(original)
+++ openjpa/branches/2.2.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java
Tue Apr 14 18:44:06 2015
@@ -2894,7 +2894,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