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

Richard Zowalla resolved OPENJPA-418.
-------------------------------------
    Resolution: Won't Fix

Closing as obsolete during backlog cleanup: JPA 2.0 made Map-valued @ManyToMany 
with entity keys standard (@MapKeyJoinColumn, handled by 
AnnotationPersistenceMappingParser.newColumn(MapKeyJoinColumn) at line 2425), 
so the 'not spec-compliant' premise no longer holds. Please reopen if this 
still happens with OpenJPA 4.x.

> @ManyToMany is allowed on a field of type whose keys and values are not 
> spec-compliant
> --------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-418
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-418
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 0.9.0, 0.9.6, 0.9.7, 1.0.0
>            Reporter: Patrick Linskey
>            Priority: Major
>
> It is possible to write an object with a Map field declared like so:
>     @ManyToMany
>     private Map<AllFieldTypes,AllFieldTypes> map =
>         new HashMap<AllFieldTypes,AllFieldTypes>();
> This should not be possible; instead, we should require @PersistentMap usage, 
> since the behavior above is not spec-compliant.
>     @PersistentMap
>     private Map<AllFieldTypes,AllFieldTypes> map =
>         new HashMap<AllFieldTypes,AllFieldTypes>();
> Or, if we decide to support @ManyToMany usage, we must review the code in the 
> PersistenceMetaDataParsers to make sure that we're doing the right things, 
> especially with keys. It looks like @ManyToMany and @PersistentMap are 
> handled very differently in that code.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to