Mapping collections using Dozer Java API (Not XML)

56 views
Skip to first unread message

Praveen Mittal

unread,
Jun 4, 2015, 7:22:26 AM6/4/15
to dozer-...@googlegroups.com
Hi,

We have been using Dozer for bean mappings in our project from quite some time. Now, we have a complex requirement in which we need to map Array to a collection which is again entry in a map. Details are explained below: -

class Source {  
    A[] a;
}

class Destination {
Map<String, Object> fields;


class B { }

If you see the above classes, we want to map 'a' from class Source to an entry in 'fields' of class Destination. the type A needs to be mapped with B and the A[] needs to be mapped with List<B>. Then we want this List<B> as entry in the fields map of Destination class.

After mapping, I should have map as below: -

fields: - "a" -> List<B>

Please suggest a solution for the above mapping using JAVA API only (not XML).

Thanks!
Reply all
Reply to author
Forward
0 new messages