Я пытаюсь сопоставить следующие DTO
С
CustomerEntity {
String name;
String street;
String city;
//getters and setters
}
С
Class Customer {
String name;
List<Address> address;
//getter and setters
}
Class Address {
String street;
String city;
//getters and setters
}
Мой код
ModelMapper modelMapper = new ModelMapper();
modelMapper.getConfiguration().setMatchingStrategy(MatchingStrategies.LOOSE); //tried STRICT too
List<CustomerEntity> custEntities = getCustEntities();
Type customerListType = new TypeToken<List<Customer>>(){}.getType();
List<Customer> customers = modelMapper.map(custEntities , customerListType);
I получить список клиентов только с именем, без адреса.
Как мне сопоставить адрес каждого клиента?
Спасибо.