openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hthom...@apache.org
Subject svn commit: r1576519 - in /openjpa/branches/2.0.x: ./ openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/ openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/joins/leftfetch/
Date Tue, 11 Mar 2014 21:59:20 GMT
Author: hthomann
Date: Tue Mar 11 21:59:20 2014
New Revision: 1576519

URL: http://svn.apache.org/r1576519
Log:
OPENJPA-2475: A query with LEFT FETCH JOIN returns incorrect results - merged changes to 2.0.x.

Added:
    openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/joins/leftfetch/
      - copied from r1575445, openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/joins/leftfetch/
    openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/joins/leftfetch/DepartmentTest.java
      - copied unchanged from r1575445, openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/joins/leftfetch/DepartmentTest.java
    openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/joins/leftfetch/PersonTest.java
      - copied unchanged from r1575445, openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/joins/leftfetch/PersonTest.java
    openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/joins/leftfetch/TestJoinLeftFetch.java
      - copied unchanged from r1575445, openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/joins/leftfetch/TestJoinLeftFetch.java
Modified:
    openjpa/branches/2.0.x/   (props changed)
    openjpa/branches/2.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/StoreCollectionFieldStrategy.java

Propchange: openjpa/branches/2.0.x/
------------------------------------------------------------------------------
  Merged /openjpa/branches/1.2.x:r1575445

Modified: openjpa/branches/2.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/StoreCollectionFieldStrategy.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/StoreCollectionFieldStrategy.java?rev=1576519&r1=1576518&r2=1576519&view=diff
==============================================================================
--- openjpa/branches/2.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/StoreCollectionFieldStrategy.java
(original)
+++ openjpa/branches/2.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/StoreCollectionFieldStrategy.java
Tue Mar 11 21:59:20 2014
@@ -218,11 +218,7 @@ public abstract class StoreCollectionFie
                 joins = sel.outer(joins);
             if (!selectOid) {
                 Column[] refs = getJoinForeignKey(elem).getColumns();
-                if (requiresOrderBy()) {
-                    sel.orderBy(refs, true, joins, true);
-                } else {
-                    sel.select(refs, joins);
-                }
+                sel.orderBy(refs, true, joins, true);
             }
             field.orderLocal(sel, elem, joins);
         }
@@ -597,8 +593,4 @@ public abstract class StoreCollectionFie
     protected ForeignKey getJoinForeignKey() {
         return getJoinForeignKey(getDefaultElementMapping(false));
     }
-    
-    boolean requiresOrderBy() {
-    	return List.class.isAssignableFrom(field.getProxyType());
-    }
 }



Mime
View raw message