Hi all, so I have the following mapping method:
@Mapper
public interface DomainDtoMapper {
@Mappings({
@Mapping(target = "targetA", source = "objA.sourceA"),
@Mapping(target = "targetB", source="objB.sourceB")
})
public DomainDto map(final DomainObjA objA, final DomainObjB objB);
}
which works perfectly if it was just used to map directly from DomainObjA and DomainObjB to DomainDto. However, when DomainDto is used by another class DomainDtoWrapper, how would I go writing DomainDtoWrapper's mapper class so that I can reuse the mapper I wrote for DomainDto? For example, I would like to be able to write
@Mapper(uses = { DomainDtoMapper.class })
public interface DomainDtoWrapper {
@Mapping(target = "domainDto", source = { "objA", "objB" })
public DomainDtoWrapper map(final DomainObjA objA, final DomainObjB objB);
}
Hi all, so I have the following mapping method:
which works perfectly if it was just used to map directly from
DomainObjAandDomainObjBtoDomainDto. However, whenDomainDtois used by another classDomainDtoWrapper, how would I go writingDomainDtoWrapper's mapper class so that I can reuse the mapper I wrote forDomainDto? For example, I would like to be able to write