Skip to content

Commit

Permalink
using cachemanager bean qualifier name
Browse files Browse the repository at this point in the history
  • Loading branch information
Hardik Singh Behl authored and Hardik Singh Behl committed Nov 20, 2023
1 parent 07c6b1f commit ee81026
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
public class WizardService {

private final ModelMapper modelMapper;
private final CacheManager cacheManager;
private final CacheManager listCacheManager;
private final WizardRepository wizardRepository;

@CacheEvict(value = "wizards", key = "#wizardCreationRequest.houseId")
Expand All @@ -52,7 +52,7 @@ public WizardDto update(@NonNull final UUID wizardId, @NonNull final WizardUpdat
modelMapper.map(WizardUpdationRequest, wizard);

final var updatedWizard = wizardRepository.save(wizard);
cacheManager.getCache("wizards").evict(wizard.getHouseId());;
listCacheManager.getCache("wizards").evict(wizard.getHouseId());;
return modelMapper.map(updatedWizard, WizardDto.class);
}

Expand All @@ -66,7 +66,7 @@ public WizardDto retrieveById(@NonNull final UUID wizardId) {
public void delete(@NonNull final UUID wizardId) {
final var wizard = getWizardById(wizardId);
wizardRepository.deleteById(wizardId);
cacheManager.getCache("wizards").evict(wizard.getHouseId());;
listCacheManager.getCache("wizards").evict(wizard.getHouseId());;
}

private Wizard getWizardById(@NonNull final UUID wizardId) {
Expand Down

0 comments on commit ee81026

Please sign in to comment.