Open GoogleCodeExporter opened 8 years ago
The default handling of collection in Orika,
dest.collection.clear(); dest.collection.addAll(mapedSourceCollection);
the elements of dest.collection are lost, and Orika create new instance from
collection source elements.
This is the Collection "merger" by default.
If you want to keep elements on destination collection and just map-in place,
you have to provide a "merger" to implement your custom logic.
Here is an example of "merger"
https://github.com/orika-mapper/orika/blob/master/tests/src/main/java/ma/glasnos
t/orika/test/community/CustomMergerTest.java#L157
this use case is used by a lot of people (we can consider to add a builtin
one).
Original comment by elaat...@gmail.com
on 17 Mar 2014 at 11:06
Hi,
Thank you for the comment. I will have a look shortly.
I would definitely welcome a built-in function to do in-place collection
mapping - that would make a lot of people (who have to handle collections!)
very very happy instead of a clear and replace :-)
-=david=-
Original comment by dharri...@gmail.com
on 17 Mar 2014 at 11:55
Original issue reported on code.google.com by
dharri...@gmail.com
on 17 Mar 2014 at 10:45