|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ObjectCache
Definition of an object cache that can be injected into the Dao with the Dao.setObjectCache(ObjectCache)
.
NOTE: Most of the below methods take a Class argument but your cache can be for a single cache. If this is the case then you should protect against storing different classes in the cache.
Method Summary | ||
---|---|---|
|
clear(Class<T> clazz)
Remove all entries from the cache of a certain class. |
|
void |
clearAll()
Remove all entries from the cache of all classes. |
|
|
get(Class<T> clazz,
ID id)
Lookup in the cache for an object of a certain class that has a certain id. |
|
|
put(Class<T> clazz,
ID id,
T data)
Put an object in the cache that has a certain class and id. |
|
|
registerClass(Class<T> clazz)
Register a class for use with this class. |
|
|
remove(Class<T> clazz,
ID id)
Delete from the cache an object of a certain class that has a certain id. |
|
|
size(Class<T> clazz)
Return the number of elements in the cache. |
|
int |
sizeAll()
Return the number of elements in all of the caches. |
|
|
updateId(Class<T> clazz,
ID oldId,
ID newId)
Change the id in the cache for an object of a certain class from an old-id to a new-id. |
Method Detail |
---|
<T> void registerClass(Class<T> clazz)
<T,ID> T get(Class<T> clazz, ID id)
<T,ID> void put(Class<T> clazz, ID id, T data)
<T,ID> void remove(Class<T> clazz, ID id)
<T,ID> T updateId(Class<T> clazz, ID oldId, ID newId)
<T> void clear(Class<T> clazz)
void clearAll()
<T> int size(Class<T> clazz)
int sizeAll()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |