can mapstruct do a merge to new object? #3503
Unanswered
caleb-cushing0-kr
asked this question in
Q&A
Replies: 1 comment
-
@caleb-cushing0-kr I am not sure that I understood your structure properly. You have I tried with the following and it works as expected @Mapper
public interface PersonMapper {
void update(UpdatePerson update, @MappingTarget Person person);
default void mergeCards(Map<String, AltIds> source, @MappingTarget Map<String, Card> cards) {
}
class Person {
protected Map<String, Card> cards;
}
class Card {
protected String id;
}
class UpdatePerson {
protected Map<String, AltIds> cards;
}
class AltIds {
protected String id;
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
e.g.
would return a new value that has applied a merge
I think this is sort of the caller api that would allow me to do it with my understanding
and how to implement that
I notice though that when I go to implement my custom copy, it doesn't actually get called
additonally relevent,
the Structure is
Person-> Map<String, Card> -> Card -> Map<String, AltIds>
Beta Was this translation helpful? Give feedback.
All reactions