0

我想在插入时设置 cacheModel ,我这样做:

<select id="SelectAll_Cache" resultClass="SN" cacheModel="cache-select-all">
    <include refid="GetAll_SN"/>
</select>

<cacheModel id="cache-select-all" implementation="LRU" readOnly="false" serialize="true">
    <flushInterval hours="24"/>
    <property name="size" value="800"/>
</cacheModel>

如果我执行查询,我会得到以下异常:

  • 将 CacheModel 设置为语句时发生错误。
  • 声明:SelectAll_Cache
  • cacheModel 中发生错误:SN.cache-select-all。
4

1 回答 1

0

在使用之前指定缓存模型。

您应该在您的 sql map 中定义缓存模型,然后在 select 语句中使用它;然后只有 ibatis sql map 解析器应该能够找到您在语句中使用的缓存模型。

于 2011-10-11T20:25:23.207 回答