Author: hthomann
Date: Thu Nov 29 22:47:57 2012
New Revision: 1415425
URL: http://svn.apache.org/viewvc?rev=1415425&view=rev
Log:
OPENJPA-2289: Applied Albert's patch to 2.2.1.x
Added:
openjpa/branches/2.2.1.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/sub/
- copied from r1415398, openjpa/branches/2.1.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/sub/
openjpa/branches/2.2.1.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/sub/MaxQueryEntity.java
- copied unchanged from r1415398, openjpa/branches/2.1.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/sub/MaxQueryEntity.java
openjpa/branches/2.2.1.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/sub/MaxQueryMapEntity.java
- copied unchanged from r1415398, openjpa/branches/2.1.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/sub/MaxQueryMapEntity.java
openjpa/branches/2.2.1.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/sub/TestSubQuery.java
- copied unchanged from r1415398, openjpa/branches/2.1.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/sub/TestSubQuery.java
Modified:
openjpa/branches/2.2.1.x/ (props changed)
openjpa/branches/2.2.1.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
openjpa/branches/2.2.1.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java
openjpa/branches/2.2.1.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java
Propchange: openjpa/branches/2.2.1.x/
------------------------------------------------------------------------------
Merged /openjpa/branches/2.1.x:r1415398
Modified: openjpa/branches/2.2.1.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.2.1.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java?rev=1415425&r1=1415424&r2=1415425&view=diff
==============================================================================
--- openjpa/branches/2.2.1.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
(original)
+++ openjpa/branches/2.2.1.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
Thu Nov 29 22:47:57 2012
@@ -1889,6 +1889,10 @@ public class DBDictionary
else if (!StringUtils.isEmpty(syntax))
throw new IllegalArgumentException(syntax);
}
+
+ public boolean isImplicitJoin() {
+ return false;
+ }
/**
* Return a SQL string to act as a placeholder for the given column.
Modified: openjpa/branches/2.2.1.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.2.1.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java?rev=1415425&r1=1415424&r2=1415425&view=diff
==============================================================================
--- openjpa/branches/2.2.1.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java
(original)
+++ openjpa/branches/2.2.1.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java
Thu Nov 29 22:47:57 2012
@@ -1365,6 +1365,10 @@ public class OracleDictionary
}
}
+ public boolean isImplicitJoin() {
+ return joinSyntax == SYNTAX_DATABASE;
+ }
+
/**
* Oracle requires special handling of XML column.
* Unless the value length is less or equal to 4000 bytes,
Modified: openjpa/branches/2.2.1.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.2.1.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java?rev=1415425&r1=1415424&r2=1415425&view=diff
==============================================================================
--- openjpa/branches/2.2.1.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java
(original)
+++ openjpa/branches/2.2.1.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java
Thu Nov 29 22:47:57 2012
@@ -2847,7 +2847,11 @@ public class SelectImpl
|| _sel._from != null) {
// don't make any joins, but update the path if a variable
// has been set
- this.append(this.var);
+ if (this.var != null) {
+ this.append(this.var);
+ } else if (this.path == null && this.correlatedVar != null &&
_sel._dict.isImplicitJoin()) {
+ this.append(this.correlatedVar);
+ }
this.var = null;
_outer = false;
return this;
|