CacheService.java 570 B

1234567891011121314151617181920212223
  1. package com.izouma.nineth.service;
  2. import org.springframework.cache.annotation.CacheEvict;
  3. import org.springframework.stereotype.Service;
  4. @Service
  5. public class CacheService {
  6. @CacheEvict(value = "collection", allEntries = true)
  7. public void clearCollection() {
  8. }
  9. @CacheEvict(value = "collection", key = "#id")
  10. public void clearCollection(Long id) {
  11. }
  12. @CacheEvict(value = "user", allEntries = true)
  13. public void clearUser() {
  14. }
  15. @CacheEvict(value = "user", key = "#username")
  16. public void clearUser(String username) {
  17. }
  18. }