openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fay Wang (JIRA)" <j...@apache.org>
Subject [jira] Updated: (OPENJPA-1021) PersistentMap MapKey applied to a relation field as key for a java.util.Map
Date Mon, 06 Apr 2009 16:42:12 GMT

     [ https://issues.apache.org/jira/browse/OPENJPA-1021?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Fay Wang updated OPENJPA-1021:
------------------------------

    Attachment: OPENJPA-1021-testcase.patch

A Junit test case is attached.

> 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: OPENJPA-1021-testcase.patch, OPENJPA-1021.patch, 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.


Mime
View raw message