Hi,
I just started using ModelMapper, so I'm sorry if this a trivial question.
I want to map multiple domain object to a single DTO object:
public class Name{
private String name;
}
public class Id{
private String id;
}
public class Dto{
public String name;
public String id;
}
(Assume getter/setters..)
I want to map both types (Name and Id) to the Dto.
The type mapping (and even the mapping) works fine:
modelMapper.createTypeMap(IdObj.class, Dto.class);
modelMapper.createTypeMap(NameObj.class, Dto.class);
But validate() fails as it expect each of the sources to fulfill all destination's fields.
Is that the recommended practice for such case?
Is there a way (configuration?) to make validation ignore missing properties in the destination?
Thanks,
Udi