public class TableCache<B extends BaseBean> extends ColumnCache<B> implements TableListener<B>
TableListener.Adapter<B>Constant.JdbcProperty, Constant.UpdateStrategydebug, duration, indexName, manager, maximumSize, metaData, unit, updateStrategy| 构造器和说明 |
|---|
TableCache(RowMetaData metaData,
Constant.UpdateStrategy updateStrategy,
java.lang.Long maximumSize,
java.lang.Long duration,
java.util.concurrent.TimeUnit unit)
constructor
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
afterDelete(B bean)
Invoked just after deleting a B record in the database.
|
void |
afterInsert(B bean)
Invoked just after a B record is inserted in the database.
|
void |
afterUpdate(B bean)
Invoked just after updating a B record in the database.
|
void |
beforeDelete(B bean)
Invoked just before deleting a B record in the database.
|
void |
beforeInsert(B bean)
Invoked just before inserting a B record into the database.
|
void |
beforeUpdate(B bean)
Invoked just before updating a B record in the database.
|
void |
done()
Invoked in finally block, just after insert,update,delete.
|
boolean |
equals(java.lang.Object obj) |
B |
getBeanByIndex(java.lang.String indexName,
java.lang.Object... keys)
return record (B) that unique indexed by 'keys'
|
B |
getBeanByIndexUnchecked(java.lang.String indexName,
java.lang.Object... keys)
return record (B) that unique indexed by 'keys'
|
int |
hashCode() |
void |
registerListener()
注册侦听器
|
java.lang.String |
toString() |
void |
unregisterListener()
注销侦听器
|
TableManager.Action<B> |
wrap(TableManager.Action<B> action)
wrap the 'action' for updating cache while retrieve data from database
|
getBean, getBeanUnchecked, getManager, onRemoval, remove, setDebug, update, updatepublic TableCache(RowMetaData metaData, Constant.UpdateStrategy updateStrategy, java.lang.Long maximumSize, java.lang.Long duration, java.util.concurrent.TimeUnit unit)
metaData - meta data for tableupdateStrategy - cache update strategy,Constant.DEFAULT_STRATEGY be used if nullmaximumSize - maximum capacity of cache ,Constant.DEFAULT_CACHE_MAXIMUMSIZE be used if null or <=0,see also CacheBuilder.maximumSize(long)duration - cache data expired time,Constant.DEFAULT_DURATION be used if null or <=0,see also CacheBuilder.expireAfterWrite(long, TimeUnit)unit - time unit for duration,Constant.DEFAULT_TIME_UNIT be used if null ,see also CacheBuilder.expireAfterWrite(long, TimeUnit)public void registerListener()
public void unregisterListener()
public B getBeanByIndex(java.lang.String indexName, java.lang.Object... keys) throws ObjectRetrievalException
indexName - index namekeys - values for index keyObjectRetrievalException - not found recordpublic B getBeanByIndexUnchecked(java.lang.String indexName, java.lang.Object... keys)
indexName - index namekeys - values for index keypublic TableManager.Action<B> wrap(TableManager.Action<B> action)
action - public void afterUpdate(B bean)
TableListenerafterUpdate 在接口中 TableListener<B extends BaseBean>bean - the B that was just updatedpublic void afterInsert(B bean)
TableListenerafterInsert 在接口中 TableListener<B extends BaseBean>bean - the B that was just insertedpublic void afterDelete(B bean)
TableListenerafterDelete 在接口中 TableListener<B extends BaseBean>bean - the B that was just deletedpublic void beforeInsert(B bean) throws RuntimeDaoException
TableListenerbeforeInsert 在接口中 TableListener<B extends BaseBean>bean - the B that is about to be insertedRuntimeDaoExceptionpublic void beforeUpdate(B bean) throws RuntimeDaoException
TableListenerbeforeUpdate 在接口中 TableListener<B extends BaseBean>bean - the B that is about to be updatedRuntimeDaoExceptionpublic void beforeDelete(B bean) throws RuntimeDaoException
TableListenerbeforeDelete 在接口中 TableListener<B extends BaseBean>bean - the B that is about to be deletedRuntimeDaoExceptionpublic void done() throws RuntimeDaoException
TableListenerdone 在接口中 TableListener<B extends BaseBean>RuntimeDaoExceptionpublic int hashCode()
hashCode 在类中 ColumnCache<B extends BaseBean>public boolean equals(java.lang.Object obj)
equals 在类中 ColumnCache<B extends BaseBean>public java.lang.String toString()
toString 在类中 ColumnCache<B extends BaseBean>Copyright © 2019. All Rights Reserved.