0

I have the following scenario of Mapping

Class Contact {

List<SimpleCode> marketSectorList;

}

Class SimpleCode {

 protected String code;
 protected String label;

}

Class ContactTarget {
  List<String> marketSectors;
}

The following map is not working
<mapping> 
    <class-a>Contact</class-a>
    <class-b>ContactTarget</class-b>  

<field>
        <a>marketSectorList</a>
        <b>marketSectors</b>
        <b-hint>java.lang.String</b-hint> 
</field> 

The mapping is not working. Please note that I can not change the classes and I would like to solve by using hints not by custom mappers

1 Answers1

1

You could try to create a mapping from SimpleCode to java.lang.String so dozer knows how to map those objects. Something similar to this:

<mapping> 
    <class-a>SimpleCode</class-a>
    <class-b>java.lang.String</class-b>  

    <field>
        <a>code</a>
        <b>this</b>
     </field>
</mapping>

I hope it helps.

vbazaga86
  • 156
  • 7