Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 62554 invoked from network); 6 Apr 2009 12:10:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 6 Apr 2009 12:10:41 -0000 Received: (qmail 97583 invoked by uid 500); 6 Apr 2009 12:10:41 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 97495 invoked by uid 500); 6 Apr 2009 12:10:40 -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 97485 invoked by uid 99); 6 Apr 2009 12:10:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Apr 2009 12:10:40 +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; Mon, 06 Apr 2009 12:10:33 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id EBC81234C003 for ; Mon, 6 Apr 2009 05:10:12 -0700 (PDT) Message-ID: <407938940.1239019812931.JavaMail.jira@brutus> Date: Mon, 6 Apr 2009 05:10:12 -0700 (PDT) From: "Michael Vorburger (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Updated: (OPENJPA-1021) PersistentMap MapKey applied to a relation field as key for a java.util.Map In-Reply-To: <928024629.1239019692944.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-1021?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Michael Vorburger updated OPENJPA-1021: --------------------------------------- Attachment: Test-OpenJPAPersistentMap.zip Test case demonstrating the "Map field ... is attempting to use a map table, but its key is mapped by another field. Use an inverse key or join table mapping." problem when using a relation field as key for a java.util.Map, using a PersistentMap & MapKey annotation. > PersistentMap MapKey applied to a relation field as key for a java.util.Map > --------------------------------------------------------------------------- > > Key: OPENJPA-1021 > URL: https://issues.apache.org/jira/browse/OPENJPA-1021 > Project: OpenJPA > Issue Type: Improvement > Components: jpa > Affects Versions: 1.2.0 > Reporter: Michael Vorburger > Attachments: Test-OpenJPAPersistentMap.zip > > > I've tried to use a relation field as key for a java.util.Map, using a PersistentMap & MapKey annotation. > Ideally, such a mapping should be supported of course. For an example real-world use case, see the test case I'll attach (it's the same that I posted to the list last week). > According to Fay Wang on users@openjpa.apache.org, this is not possible today (v1.2.0), see http://mail-archives.apache.org/mod_mbox/openjpa-users/200904.mbox/%3C188945.43609.qm@web55901.mail.re3.yahoo.com%3E (the short email exchange which lead to the creation of this JIRA). > According to Pinaki Poddar on http://n2.nabble.com/Map%3CClassA,ClassB%3E-problem-td534546.html this should work. Either way, the current error message ("Map field ... is attempting to use a map table, but its key is mapped by another field. Use an inverse key or join table mapping.") is unclear. > At the very least, the documentation manual should clearly say that this is explicitly not supported, or include an example if it is, and/or a clear error message should be printed by the run-time. Ideally it should be a working and documenting mapping though... -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.