We have an object structure with a parent and a list of children. The child objects are of different type but all implement the same interface. Assume the following mapping:
<b set-method="addChild" type="iterate">children</b>
The mapping fails because MappingProcessor assumes that only one destination hint is present. This seems to be an unnecessary restriction. The following patch fixes the issue in our case:
$ diff MappingProcessor.java MappingProcessor.java.patched
< value = map(value, fieldMapping.getDestHintContainer().getHint());
> value = map(value, fieldMapping.getDestHintType(value.getClass()));
please consider applying this patch to the dozer codebase.
Log in to post a comment.