public enum QueryCache extends Enum<QueryCache>
Enum Constant and Description |
---|
INSTANCE |
Modifier and Type | Method and Description |
---|---|
void |
addItem(String tableName,
String query,
Object[] params,
Object cache)
Adds an item to cache.
|
CacheManager |
getCacheManager() |
Object |
getItem(String tableName,
String query,
Object[] params)
Returns an item from cache, or null if nothing found.
|
static QueryCache |
instance()
This class is a singleton, get an instance with this method.
|
boolean |
isEnabled() |
void |
purgeTableCache(MetaModel metaModel)
This method purges (removes) all caches associated with a table, if caching is enabled and
a corresponding model is marked cached.
|
void |
purgeTableCache(String tableName)
Use
purgeTableCache(MetaModel) whenever you can. |
static QueryCache |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static QueryCache[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final QueryCache INSTANCE
public static QueryCache[] values()
for (QueryCache c : QueryCache.values()) System.out.println(c);
public static QueryCache valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic boolean isEnabled()
public static QueryCache instance()
public void addItem(String tableName, String query, Object[] params, Object cache)
tableName
- - name of table.query
- query textparams
- - list of parameters for a query.cache
- object to cache.public Object getItem(String tableName, String query, Object[] params)
tableName
- name of table.query
- query text.params
- list of query parameters, can be null if no parameters are provided.public void purgeTableCache(MetaModel metaModel)
metaModel
- meta-model whose caches are to purge.public void purgeTableCache(String tableName)
purgeTableCache(MetaModel)
whenever you can.tableName
- name of table whose caches to purge.public CacheManager getCacheManager()
Copyright © 2020 JavaLite. All rights reserved.