K - 主键类型(Primary or Unique)B - 数据库记录对象类型(Java Bean)public interface ITableCache<K,B extends BaseBean<B>>
| 限定符和类型 | 接口和说明 |
|---|---|
static class |
ITableCache.ImmutableEntry<K,V> |
static class |
ITableCache.UpdateStrategy
Update strategy for cache
|
| 限定符和类型 | 字段和说明 |
|---|---|
static long |
DEFAULT_CACHE_MAXIMUMSIZE |
static long |
DEFAULT_DURATION |
static ITableCache.UpdateStrategy |
DEFAULT_STRATEGY |
static java.util.concurrent.TimeUnit |
DEFAULT_TIME_UNIT |
| 限定符和类型 | 方法和说明 |
|---|---|
B |
getBean(K key)
加载主键(key)指定的记录,如果缓存中没有则从数据库中查询
数据库中没有找到则抛出异常 |
B |
getBeanIfPresent(K key)
返回cache中
key指定的记录,如果不存在就返回null |
B |
getBeanUnchecked(K key)
加载主键(key)指定的记录,如果缓存中没有则从数据库中查询
数据库中没有找到则返回 null |
void |
registerListener()
注册侦听器
|
void |
remove(B bean)
删除cache中
key指定的记录 |
void |
unregisterListener()
注销侦听器
|
void |
update(B bean)
向cache中更新数据
|
static final ITableCache.UpdateStrategy DEFAULT_STRATEGY
static final long DEFAULT_CACHE_MAXIMUMSIZE
static final long DEFAULT_DURATION
static final java.util.concurrent.TimeUnit DEFAULT_TIME_UNIT
B getBean(K key) throws java.lang.Exception
key - java.lang.ExceptionB getBeanUnchecked(K key)
nullkey - B getBeanIfPresent(K key)
key指定的记录,如果不存在就返回nullkey - void update(B bean)
bean - ITableCache.UpdateStrategyvoid registerListener()
void unregisterListener()
Copyright © 2019. All Rights Reserved.