https://www.devglan.com/online-tools/jasypt-online-encryption-decryption
mvn-Djasypt.encryptor.password=secretkye spring-boot:run
@EnableEncryptableProperties
@Cacheable(value = "users", key = "#userId") public User getUser(String userId) { return userRepository.findOne(Long.valueOf(userId)); }
@Cacheable(cacheNames = "myControlledCache", key = "'myControlledPrefix_'.concat(#relevant)") public String getFromCache(String relevant) { return null; }
@CacheEvict(cacheNames = "myControlledCache", key = "'myControlledPrefix_'.concat(#relevant)") public void removeFromCache(String relevant) { }
@CacheEvict(cacheNames = "myControlledCache", allEntries=true) public void removeFromCache(String relevant) { }
@CacheEvict(cacheNames = "myControlledCache"){...}
@CacheEvict(value="addresses", allEntries=true) public String getAddress(Customer customer) {...}
@CachePut(cacheNames = "myControlledCache"){...}
@CachePut(cacheNames = "myControlledCache", key = "'myControlledPrefix_'.concat(#relevant)") public String populateCache(String relevant, String unrelevantTrackingId) { return "this is it again!"; }
@CachePut(value="addresses") public String getAddress(Customer customer) {...}
@CacheConfig annotation, you can streamline some of the cache configuration into a single place – at the class level – so that you don't have to declare things multiple times:
@CacheConfig(cacheNames={"addresses"}) public class CustomerDataService {
@Cacheable
public String getAddress(Customer customer) {...}