<!-- 缓存,读取的时候不可以修改,留下使用最频繁的元素--> <cacheModel type="LRU" id="getAreas-cache"> <flushInterval hours="24"/> <property name="cache-size" value="1000"/> </cacheModel> <!-- 查询版块列表 --> <select id="getAreas" resultMap="area" cacheModel="getAreas-cache"> SELECT * FROM area </select> LRL代码当缓存满了时,去掉使用最不频繁的元素。 <cacheModel id="product-cache" type="FIFO"> <flushInterval hours="24"/> <flushOnExecute statement="insertProduct"/> <flushOnExecute statement="updateProduct"/> <flushOnExecute statement="deleteProduct"/> <property name=”size” value=”1000” /> </cacheModel> FIFO是当内存满了时,去掉旧的元素。 <cacheModel id="product-cache" type ="LRU" readOnly=”true”> <flushInterval hours="24"/> <flushOnExecute statement="insertProduct"/> <flushOnExecute statement="updateProduct"/> <flushOnExecute statement="deleteProduct"/> <property name=”cache-size” value=”1000” /> </cacheModel> flushOnExecute但调用某个方法是刷新缓存。
ibatis缓存
最新推荐文章于 2018-04-18 17:57:04 发布