Class TSqlMapCacheModel
TSqlMapCacheModel corresponds to the <cacheModel> sql mapping configuration tag.
The results from a query Mapped Statement can be cached simply by specifying the CacheModel property in <statement> tag. A cache model is a configured cache that is defined within the sql map configuration file. Cache models are configured using the <cacheModel> element. The cache model uses a pluggable framework for supporting different types of caches. The choice of cache is specified by the Implementation property. The class name specified must be one of TSqlMapCacheTypes. The cache implementations, LRU and FIFO cache below do not persist across requests. That is, once the request is complete, all cache data is lost. These caches are useful queries that results in the same repeated data during the current request.
Method Summary |
void
|
Clears the cache.
|
mixed
|
|
integer
|
|
float
|
|
string
|
|
string
|
|
string
|
|
void
|
Initialize the cache implementation, sets the actual cache contain if supplied.
|
void
|
Register a mapped statement that will trigger a cache flush.
|
void
|
|
void
|
|
void
|
|
void
|
|
Methods Inherited From TComponent |
TComponent::addParsedObject(), TComponent::attachEventHandler(), TComponent::canGetProperty(), TComponent::canSetProperty(), TComponent::createdOnTemplate(), TComponent::detachEventHandler(), TComponent::evaluateExpression(), TComponent::evaluateStatements(), TComponent::getEventHandlers(), TComponent::getSubProperty(), TComponent::hasEvent(), TComponent::hasEventHandler(), TComponent::hasProperty(), TComponent::raiseEvent(), TComponent::setSubProperty(), TComponent::__get(), TComponent::__set()
|
Method Details |
flush
Clears the cache.
|
get
Input |
TSqlMapCacheKey|string | $key | cache key |
Output |
mixed
| cached value. |
Exception |
|
getFlushInterval
public integer getFlushInterval |
() |
Output |
integer
| cache duration. |
Exception |
|
getHitRatio
public float getHitRatio |
() |
Output |
float
| cache hit ratio. |
Exception |
|
getID
Output |
string
| unique cache model identifier. |
Exception |
|
getImplementation
public string getImplementation |
() |
Output |
string
| cache implements of TSqlMapCacheTypes, either 'Basic', 'LRU' or 'FIFO'. |
Exception |
|
getImplementationClass
public string getImplementationClass |
() |
Output |
string
| cache implementation class name. |
Exception |
|
initialize
public void initialize |
(ISqLMapCache $cache ) |
Initialize the cache implementation, sets the actual cache contain if supplied.
Input |
ISqLMapCache | $cache | cache implementation instance. |
Output |
Exception |
|
registerTriggerStatement
Register a mapped statement that will trigger a cache flush.
Input |
TMappedStatement | $mappedStatement | mapped statement that may flush the cache. |
Output |
Exception |
|
set
Input |
TSqlMapCacheKey|string | $key | cache key |
mixed | $value | value to be cached. |
Output |
Exception |
|
setFlushInterval
public void setFlushInterval |
(integer $value ) |
Input |
integer | $value | the number of seconds in which the cached value will expire. 0 means never expire. |
Output |
Exception |
|
setID
public void setID |
(string $value ) |
Input |
string | $value | unique cache model identifier. |
Output |
Exception |
|
setImplementation
public void setImplementation |
(string $value ) |
Input |
string | $value | cache implements of TSqlMapCacheTypes, either 'Basic', 'LRU' or 'FIFO'. |
Output |
Exception |
|
|