T - 实体public interface SuperCacheService<T> extends SuperService<T>
| 限定符和类型 | 方法和说明 |
|---|---|
void |
clearCache()
清理缓存
|
List<T> |
findByIds(Collection<? extends Serializable> ids,
Function<Collection<? extends Serializable>,Collection<T>> loader)
可能会缓存穿透
|
T |
getByIdCache(Serializable id)
根据id 先查缓存,再查db
|
T |
getByKey(CacheKey key,
Function<CacheKey,Object> loader)
根据 key 查询缓存中存放的id,缓存不存在根据loader加载并写入数据,然后根据查询出来的id查询 实体
|
void |
refreshCache()
刷新缓存
|
getEntityClass, saveBatchSomeColumn, updateAllByIdcount, count, getBaseMapper, getById, getMap, getObj, getOne, getOne, ktQuery, ktUpdate, lambdaQuery, lambdaUpdate, list, list, listByIds, listByMap, listMaps, listMaps, listObjs, listObjs, listObjs, listObjs, page, page, pageMaps, pageMaps, query, remove, removeBatchByIds, removeBatchByIds, removeBatchByIds, removeBatchByIds, removeById, removeById, removeById, removeByIds, removeByIds, removeByMap, save, saveBatch, saveBatch, saveOrUpdate, saveOrUpdate, saveOrUpdateBatch, saveOrUpdateBatch, update, update, update, updateBatchById, updateBatchById, updateByIdT getByIdCache(Serializable id)
id - 主键T getByKey(CacheKey key, Function<CacheKey,Object> loader)
key - 缓存keyloader - 加载器List<T> findByIds(@NonNull Collection<? extends Serializable> ids, Function<Collection<? extends Serializable>,Collection<T>> loader)
ids - 主键idloader - 回调void refreshCache()
void clearCache()
Copyright © 2022. All rights reserved.