-
-
Save Mistic92/5043b682aa5742a7d7fad68c7ad8722c to your computer and use it in GitHub Desktop.
Ignite problems
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Repository | |
@Slf4j | |
@SuppressWarnings("unused") | |
@CacheConfig(cacheNames = { | |
"ch-last", | |
"ch-past", "ch-all", | |
"ch-current"}) | |
public class RepositoryOne { | |
/** | |
* Do not call directly from the same class | |
*/ | |
@Caching(evict = { | |
@CacheEvict(value = "ch-past", key = "{#uid,0}"), | |
@CacheEvict(value = "ch-current", key = "{#uid,0}"), | |
@CacheEvict(value = "ch-last", key = "{#uid,#somethingType.toString()}"), | |
@CacheEvict(value = "ch-given-time", key = "{#uid,#somethingType.toString()}"), | |
}) | |
public void evictUsereData(final String uid, SomethingType somethingType) { | |
log.debug("Evicted something for uid:{}", uid); | |
} | |
@Override | |
@Cacheable(cacheNames = "ch-current", key = "{#userId.name(),#page}") | |
public List<SomethingEntity> getCurrentDataForUserId(DatastoreKey userId, int page) { | |
//............... | |
return something; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment