@Singleton
public record RequestToCountryMapper() implements BiFunction {
@Override
public Country apply(CountryRequest countryRequest, Country country) {
return new Country(country.id(),
countryRequest.name(),
countryRequest.shortName(),
countryRequest.url(),
countryRequest.matchPlayed(),
countryRequest.win(),
countryRequest.draw(),
countryRequest.lost(),
countryRequest.points());
}
}
Обновленное значение Бельгия изменено на Бельгия
Когда я снова делаю запрос на получение, срабатывает старое значение. Обновление не произошло
@Override public Optional patch(UUID id, CountryRequest request) { Country country = rootProvider.root().getCountry().get(id); if (country == null) throw new RuntimeException(Constants.NO_Record_Found); var updateCountry = updateCountry(country,request); return Optional.of(this.countryToResponseMapper.apply(updateCountry)); }
@StoreReturn protected Country updateCountry(Country country, CountryRequest request) { return this.requestToCountryMapper.apply(request, country); } } [/code] [b]RequestToCountryMapper[/b] [code]@Singleton public record RequestToCountryMapper() implements BiFunction { @Override public Country apply(CountryRequest countryRequest, Country country) { return new Country(country.id(), countryRequest.name(), countryRequest.shortName(), countryRequest.url(), countryRequest.matchPlayed(), countryRequest.win(), countryRequest.draw(), countryRequest.lost(), countryRequest.points()); } } [/code] Обновленное значение [b]Бельгия[/b] изменено на [b]Бельгия[/b] [img]https://i.sstatic.net/CTJ33srk.png[/img]
Когда я снова делаю запрос на получение, срабатывает старое значение. Обновление не произошло