openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Vorburger (JIRA)" <j...@apache.org>
Subject [jira] Created: (OPENJPA-1021) PersistentMap MapKey applied to a relation field as key for a java.util.Map
Date Mon, 06 Apr 2009 12:08:12 GMT
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


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