[
https://issues.apache.org/jira/browse/OPENJPA-1021?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Richard Zowalla resolved OPENJPA-1021.
--------------------------------------
Resolution: Fixed
Already fixed on master: Commits d0cb71dd5, 5580dd3ea and 8c31381f1
'OPENJPA-1021 allow MapKey on relation field' are ancestors of master (git
merge-base --is-ancestor) and changed RelationMapInverseKeyFieldStrategy and
RelationMapTableFieldStrategy. Closing.
> 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
> Priority: Major
> 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 [email protected], this is not possible today
> (v1.2.0), see
> http://mail-archives.apache.org/mod_mbox/openjpa-users/200904.mbox/%[email protected]%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 was sent by Atlassian Jira
(v10.3.26#10030026)