#109 Map-backed mapping with map-id

Dan Cruz

I've recently updated from Dozer 2.4 to 4.0. I have a one-way mapping from a java.util.Map to a JavaBean with a map-id defined that no longer works without modification. I've traced the issue to the ClassMapFinder.findInterfaceMappings() use of ClassMapKeyFactory.createKey(Class, Class) without specifying the mapId.

As an example, using the following mapping:

<mapping map-id="testMap" map-null="false" type="one-way">
<a key="aStringValue">this</a>

where class A is a java.util.Hashtable and TestBean is a simple JavaBean with a single stringValue property, and MapperIF.map(testHashTable, TestBean.class, "testMap") is called, the mapping will not occur since the cache key used to find the ClassMap is "SOURCE CLASS-->java.util.Map DEST CLASS-->TestBean", which differs from the existing cache key of "SOURCE CLASS-->java.util.Map DEST CLASS-->TestBean MAP ID-->testMap". If you change the class-a element to java.util.Hashtable, the mapping will occur.


  • Matt Tierney

    Matt Tierney - 2007-12-16

    Logged In: YES
    Originator: NO

    I create a unit test for this use case in the 4.2 code base and it ran green. I don't see any noticeable differences, so this may have been indirectly resolved by another fix. I checked in the unit test --> MapTypeTest.testMapToVoUsingMapInterface()

  • Matt Tierney

    Matt Tierney - 2007-12-16
    • assigned_to: nobody --> mhtierney
    • status: open --> pending
  • Matt Tierney

    Matt Tierney - 2007-12-16
    • status: pending --> closed

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks