开发者

ibatis - where to place the <cacheModel> tag?

I have the map config file like this

<sqlMap ..............>

    <alias>
      <typeAlias ......../>
    </alias>

    <statements>
      ....
      <sql>....</sql>
      <select cacheModel="cache-select-all">....</select>
      <update>...</update>
      <procedure>...</procedure>
      .....
    </statements>    

    <parameterMaps>
      <parameterMap>....</parameterMa开发者_JS百科p>
    </parameterMaps>

    <cacheModel id="cache-select-all" type="LRU" readOnly="true" serialize="false">
      <flushInterval hours="24"/>
      <flushOnExecute statement="InsertIOs"/>
      <!--<property name="CacheSize" value="1000"/>-->
    </cacheModel>

  </sqlMap>

I am using ibatis (.net, if that matters) and i have one question: where to place the tags? is There a or because placing it like i did, in the statements seems not to work. What am i doing wrong?


You must reference the cacheModel you defined inside a statement tag as shown in the following link:

http://ibatis.apache.org/docs/dotnet/datamapper/ch03s08.html


Before you use it in the select statement. Order does matter here. Otherwise sql map parser wouldn't be able to validate your sql map.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜