Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 8716 invoked from network); 22 Sep 2009 20:15:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 22 Sep 2009 20:15:02 -0000 Received: (qmail 84777 invoked by uid 500); 22 Sep 2009 20:15:02 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 84746 invoked by uid 500); 22 Sep 2009 20:15:02 -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 84736 invoked by uid 99); 22 Sep 2009 20:15:02 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Sep 2009 20:15:02 +0000 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; Tue, 22 Sep 2009 20:14:58 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id A1B67234C4B0 for ; Tue, 22 Sep 2009 13:12:16 -0700 (PDT) Message-ID: <390836962.1253650336661.JavaMail.jira@brutus> Date: Tue, 22 Sep 2009 13:12:16 -0700 (PDT) From: "Donald Woods (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Updated: (OPENJPA-1283) Incorrect SQL for JPQL query selecting Map value from an elementCollection of a Map and the map the value is an embeddable In-Reply-To: <413557422.1251926134331.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/OPENJPA-1283?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Donald Woods updated OPENJPA-1283: ---------------------------------- Affects Version/s: (was: 2.0.0) 2.0.0-M2 Fix Version/s: (was: 2.0.0) 2.0.0-M3 > Incorrect SQL for JPQL query selecting Map value from an elementCollection of a Map and the map the value is an embeddable > -------------------------------------------------------------------------------------------------------------------------- > > Key: OPENJPA-1283 > URL: https://issues.apache.org/jira/browse/OPENJPA-1283 > Project: OpenJPA > Issue Type: Bug > Affects Versions: 2.0.0-M2 > Reporter: Catalina Wei > Assignee: Catalina Wei > Fix For: 2.0.0-M3 > > > SELECT VALUE(f) FROM Policy p, IN (p.funds) f WHERE f.fundName = :fName and p.annuityHolderId = :holderId > Where Policy has an ElementCollection as a Map: > @ElementCollection(targetClass = Fund.class, fetch=FetchType.EAGER) > @CollectionTable(name="POLICY_FUNDS",joinColumns={@JoinColumn(name="FK_POLICY_ID")}) > @MapKeyColumn(name = "FUND_ID") > public Map getFunds() { > return Funds; > } > The generated SQL was incorrect: > SELECT t2.id FROM INSPOLICY t0 > INNER JOIN POLICY_FUNDS t1 ON t0.id = t1.FK_POLICY_ID, > INSPOLICY t2 > WHERE (t1.fundName = ? AND t0.FK_ANNUITY_HOLDER_ID = ?) > The correct SQL should projecting out t1.*. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.