Java Reference
In-Depth Information
<select
id="getCategory" parameterClass="Category"
resultClass="Category" cacheModel="categoryCache">
SELECT *
FROM Category
WHERE parentCategoryId=#categoryId#
</select>
</sqlMap>
Something to keep in mind when using <flushInterval> is that only one attribute
is allowed. So if you want to flush a cache every 12 hours, 10 minutes, 10 seconds,
and 5 milliseconds, you have to calculate that as milliseconds, and enter the value
as such.
9.4.2
Setting cache model implementation properties
Because cache models are components that can be plugged into the framework,
there must be a way to supply arbitrary values to the component. The <property>
tag is used to do just that. This tag's attributes appear in table 9.6.
Table 9.6
<property> tag attributes
The name of the property being set
name
(required)
The value of the property being set
value
(required)
Both the name and value attributes are required, and are used to build a Proper-
ties object that is passed to the cache model component to initialize it.
So, in general, configuration of the cache is not completely independent of
the type of cache you use. Therefore, an understanding of the types available, and
the options specific to each of them, is required.
9.5 Cache model types
As mentioned in section 9.3.1, four cache model types that come with iBATIS for
use in your application:
MEMORY
LRU
Search WWH ::




Custom Search