2010-07-16 15 views
0

我想設置cacheModel上插入,我不喜歡這樣寫道:ibatis的 - 不能設置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中的錯誤。
+0

問題解決:必須有一個標記和所有標記 – ion 2010-07-16 14:11:23

+0

如果您找到答案,然後將其作爲aswer發佈並接受它。 – leonbloy 2010-07-21 16:12:08

回答

0

指定緩存模型,然後再使用它。

您應該在select語句中使用它之前,在您的sql映射中定義緩存模型;然後只有ibatis sql map解析器應該能夠找到您在語句中使用的緩存模型。