Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 48802 invoked from network); 1 Aug 2008 19:32:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Aug 2008 19:32:53 -0000 Received: (qmail 64049 invoked by uid 500); 1 Aug 2008 19:32:52 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 63878 invoked by uid 500); 1 Aug 2008 19:32:52 -0000 Mailing-List: contact dev-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 dev@openjpa.apache.org Received: (qmail 63867 invoked by uid 99); 1 Aug 2008 19:32:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Aug 2008 12:32:52 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Aug 2008 19:32:05 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id B2B30234C188 for ; Fri, 1 Aug 2008 12:32:31 -0700 (PDT) Message-ID: <1621769004.1217619151720.JavaMail.jira@brutus> Date: Fri, 1 Aug 2008 12:32:31 -0700 (PDT) From: "Pinaki Poddar (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Resolved: (OPENJPA-485) Generates syntactically wrong SQL query for JPQL that uses ORDER BY on TABLE_PER_CLASS inheritance hierarchy In-Reply-To: <3627945.1200334114725.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/OPENJPA-485?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Pinaki Poddar resolved OPENJPA-485. ----------------------------------- Resolution: Fixed Fix Version/s: 1.3.0 1.2.0 Fixed on trunk with revision 681781. Merged to 1.2.0 with revision 681788. The change has unintended but positive impact on a) previously failed test on org\apache\openjpa\persistence\managedinterface\TestManagedInterfaces.java (OPENJPA-481) b) it now supports traversal through a collection valued path expression. SELECT s FROM Student s WHERE s.departments.name = 'XYZ' will return Students whose any of the departments in 'XYZ' This is not kosher as per JPA Spec but apparently convenient for the user. See org\apache\openjpa\persistence\jpql\clauses\TestEJBClauses.java > Generates syntactically wrong SQL query for JPQL that uses ORDER BY on TABLE_PER_CLASS inheritance hierarchy > ------------------------------------------------------------------------------------------------------------ > > Key: OPENJPA-485 > URL: https://issues.apache.org/jira/browse/OPENJPA-485 > Project: OpenJPA > Issue Type: Bug > Components: query > Reporter: Pinaki Poddar > Assignee: Pinaki Poddar > Fix For: 1.2.0, 1.3.0 > > > Symptom: > Generates wrong SQL query > "SELECT t1.id, t1.name, t0.name FROM ORDER BY t0.name ASC" > for a JPQL Query > "SELECT p FROM Base p ORDER BY p.name" > Condition: > where Base class uses TABLE_PER_CLASS inheritance strategy and has one or more known subclasses. > Cause: > The routine that fails to handle aliasing and leaves the table in FROM clause empty is JDBCStoreManager.selectBaseMappings() line 1028-1031. > Note: > Queries that do not use ORDER BY on the same class hierarchy such as > "SELECT p FROM Base [WHERE ]" > works. > > -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.