I have the following Entity Classes:
class Provider{
private String providerId;
private String identificationNumber;
private Account account;
// Setters, Getters and toString
}
class Account {
private String name;
private String lastname;
private String email;
// Setters, Getters and toString
}
DTO:
class ProviderDTO{
private String providerId;
private String identificationNumber;
private String accountName;
private String accountLastname;
//Setters, Getters and toString
}
If I try to map my DTO to the Provider entity using (MatchingStrategies.STRICT
):
Provider provider = modelMapper.map(providerDTO,Provider.class);
provider.getAccount().getName()
is null and
provider.getAccount().getName()
is null
But if I using a (MatchingStrategies.STANDARD
):
Works perfectly....
provider.getAccount().getName()
is not null and
provider.getAccount().getName()
is not null
My question is: how should I name the properties of my DTO so that modelmapper works in STRICT mode?
I would like to receive an explanation of how strict mode works, because I did not find examples, even on the official modelmapper website. Many thanks!