A single-line patch to make MappingProcessor use multiple hints for destination classes during mapping of fields. It changes the behaviour of MappingProcessor only if both source and dest. hints are specified AND both are comma-separated lists (as described in the HintContainer).
This was needed when we wanted to map between a hierarchy of classes occurring as field types.
In short words:
Imagine a class A (will be mapped to APrime) with field "x" of type "X" (mapped to "x" of type "XPrime"). And now X type is abstract having several concrete subclasses (X1,X2,X3). The same hierarchy on the "right-hand-side" (XPrime having subclasses: X1Prime, X2Prime, X3Prime).
Let's say we want to map an instance of class A to APrime without knowing the very detail runtime type of x field value.
The solution is to have the mapping as follows:
and run it like this:
mapper.map(new A(new X2(5L)), APrime.class);
Without this patch it doesn't work. Patching fixes the problem.
Log in to post a comment.