- 新增jar报 oscache-2.4.1.jar
- 新增 oscache.properties 配置文件
- 全局文件SqlMapConfig.xml 中开启缓存 cacheModelsEnabled="true"
- 在每个namespace 空间 定义
<cacheModel type="OSCACHE" id="SystemCache" readOnly="true"> <flushInterval hours="24" /> <property name="size" value="1000" /> </cacheModel> 5. 使用 cacheModel 引用 缓存 <select id="getSelectedObjectID" resultClass="java.lang.Integer" cacheModel="SystemCache"> select obj_id from t_system_object where is_select = 1 limit 1 </select>