类 SpringDataResourceCacheManager<ENTITY extends Entity<ID>,ID extends Serializable,REPOSITORY extends org.springframework.data.repository.PagingAndSortingRepository<ENTITY,ID>>
- java.lang.Object
-
- com.github.developframework.resource.AbstractResourceManager<ENTITY,ID>
-
- com.github.developframework.resource.spring.SpringDataResourceManager<ENTITY,ID,REPOSITORY>
-
- com.github.developframework.resource.spring.SpringDataResourceCacheManager<ENTITY,ID,REPOSITORY>
-
- 所有已实现的接口:
ResourceManager<ENTITY,ID>
public abstract class SpringDataResourceCacheManager<ENTITY extends Entity<ID>,ID extends Serializable,REPOSITORY extends org.springframework.data.repository.PagingAndSortingRepository<ENTITY,ID>> extends SpringDataResourceManager<ENTITY,ID,REPOSITORY>
spring-data资源缓存管理器- 作者:
- qiushui on 2020-05-01.
-
-
字段概要
字段 修饰符和类型 字段 说明 protected StringcacheKeyprotected ResourceCacheOperate<ENTITY,ID>cacheOperateprotected CacheTypecacheTypeprotected org.springframework.data.redis.core.RedisTemplate<String,ENTITY>redisTemplateprotected Durationtimeout-
从类继承的字段 com.github.developframework.resource.spring.SpringDataResourceManager
repository, transactionTemplate
-
从类继承的字段 com.github.developframework.resource.AbstractResourceManager
resourceDefinition, resourceHandler, resourceOperateRegistry
-
-
构造器概要
构造器 构造器 说明 SpringDataResourceCacheManager(REPOSITORY repository, ResourceDefinition<ENTITY> resourceDefinition, String cacheKey, Duration timeout, CacheType cacheType)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 Optional<ENTITY>add(Object dto)protected booleancacheAble(ENTITY entity)判断是否需要缓存voidinitCacheOperate()Optional<ENTITY>modifyById(ID id, Object dto)booleanremove(ENTITY entity)Optional<ENTITY>removeById(ID id)-
从类继承的方法 com.github.developframework.resource.spring.SpringDataResourceManager
list, list, pager
-
从类继承的方法 com.github.developframework.resource.AbstractResourceManager
assertExistsById, byFieldAddCheck, byFieldModifyCheck, execSearchOperate, execSearchOperate, existsById, findOneById, findOneByIdRequired, getResourceDefinition, getResourceHandler, getResourceOperateRegistry, modify
-
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
从接口继承的方法 com.github.developframework.resource.ResourceManager
listForIds
-
-
-
-
字段详细资料
-
redisTemplate
protected org.springframework.data.redis.core.RedisTemplate<String,ENTITY extends Entity<ID>> redisTemplate
-
cacheKey
protected final String cacheKey
-
timeout
protected final Duration timeout
-
cacheType
protected final CacheType cacheType
-
cacheOperate
protected ResourceCacheOperate<ENTITY extends Entity<ID>,ID extends Serializable> cacheOperate
-
-
构造器详细资料
-
SpringDataResourceCacheManager
public SpringDataResourceCacheManager(REPOSITORY repository, ResourceDefinition<ENTITY> resourceDefinition, String cacheKey, Duration timeout, CacheType cacheType)
-
-
方法详细资料
-
initCacheOperate
@PostConstruct public void initCacheOperate()
-
add
public Optional<ENTITY> add(Object dto)
- 指定者:
add在接口中ResourceManager<ENTITY extends Entity<ID>,ID extends Serializable>- 覆盖:
add在类中SpringDataResourceManager<ENTITY extends Entity<ID>,ID extends Serializable,REPOSITORY extends org.springframework.data.repository.PagingAndSortingRepository<ENTITY,ID>>
-
modifyById
public Optional<ENTITY> modifyById(ID id, Object dto)
- 指定者:
modifyById在接口中ResourceManager<ENTITY extends Entity<ID>,ID extends Serializable>- 覆盖:
modifyById在类中SpringDataResourceManager<ENTITY extends Entity<ID>,ID extends Serializable,REPOSITORY extends org.springframework.data.repository.PagingAndSortingRepository<ENTITY,ID>>
-
remove
public boolean remove(ENTITY entity)
- 指定者:
remove在接口中ResourceManager<ENTITY extends Entity<ID>,ID extends Serializable>- 覆盖:
remove在类中SpringDataResourceManager<ENTITY extends Entity<ID>,ID extends Serializable,REPOSITORY extends org.springframework.data.repository.PagingAndSortingRepository<ENTITY,ID>>
-
removeById
public Optional<ENTITY> removeById(ID id)
- 指定者:
removeById在接口中ResourceManager<ENTITY extends Entity<ID>,ID extends Serializable>- 覆盖:
removeById在类中SpringDataResourceManager<ENTITY extends Entity<ID>,ID extends Serializable,REPOSITORY extends org.springframework.data.repository.PagingAndSortingRepository<ENTITY,ID>>
-
cacheAble
protected boolean cacheAble(ENTITY entity)
判断是否需要缓存- 参数:
entity-- 返回:
-
-