Код: Выделить всё
public class Site {
private UUID uuid;
private UUID countryUuid;
}
Код: Выделить всё
public class Country {
private UUID uuid;
@Column(nullable = false)
private String name;
@Column(nullable = false)
private String code;
@Column(nullable = false)
private Currency currency;
}
Код: Выделить всё
// get site list
final List siteList = siteService.findAllByUuidIn(siteUuidList);
// then get country list
final List countryList = siteList.stream()
.map(SiteDTO::getCountry).collect(Collectors.toList());
// then finall try to map them to Currency
final Map uuidCurrencyMap = countryList
.stream().collect(Collectors.toMap(CountryDTO::getUuid, Function.identity()));
Подробнее здесь: https://stackoverflow.com/questions/702 ... es-in-java