Return-Path: X-Original-To: apmail-openjpa-commits-archive@www.apache.org Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3ABDFDE69 for ; Thu, 29 Nov 2012 22:48:21 +0000 (UTC) Received: (qmail 94205 invoked by uid 500); 29 Nov 2012 22:48:21 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 94158 invoked by uid 500); 29 Nov 2012 22:48:21 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 94142 invoked by uid 99); 29 Nov 2012 22:48:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Nov 2012 22:48:21 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Nov 2012 22:48:19 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id E13DD23888E4; Thu, 29 Nov 2012 22:47:58 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1415425 - in /openjpa/branches/2.2.1.x: ./ openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/ openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/sub/ Date: Thu, 29 Nov 2012 22:47:58 -0000 To: commits@openjpa.apache.org From: hthomann@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20121129224758.E13DD23888E4@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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;