I am trying to convert two classes that have an attribute of type java.util.List, but one of the classes does not have a method "set*" only the method "get*" like this:
<mapping>
<class-a>com.mycompany.bean.SocioPj</class-a>
<class-b>com.mycompany.jaxb.SocioPjXml</class-b>
<field>
<a set-method="getListaSocios().add">listaSocios</a>
<b>listaSocios</b>
<a-hint>com.mycompany.bean.SocioPf,com.mycompany.bean.SocioPj</a-hint>
<b-hint>com.mycompany.jaxb.SocioPfXml,com.mycompany.jaxb.SocioPjXml</b-hint>
</field>
</mapping>
The example above the class: SocioPj doesn´t have a method setListSocios() when I tried to convert I catch this error:
[Time:2015-03-24 11:29:08,055][Level:ERROR][Thread:http-bio-8080-exec-10][OnboardingCCMFulfillmentImpl] org.dozer.MappingException: java.lang.ClassNotFoundException: /add
Has anyone faced this problem?
You can tell Dozer to directly access the field without calling the getter/setter (Even if the field is private
):
<field>
<a is-accessible="true">listaSocios</a>
<b>listaSocios</b>
</field>