<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">

<sqlMap namespace="Category">

  <cacheModel id="oneDayCategory" type="MEMORY">
    <flushInterval hours="24"/>
    <property name="reference-type" value="WEAK"/>
  </cacheModel>

  <resultMap id="result" class="org.springframework.samples.jpetstore.domain.Category">
    <result property="categoryId" column="catid" columnIndex="1"/>
    <result property="name" column="name" columnIndex="2"/>
    <result property="description" column="descn" columnIndex="3"/>
  </resultMap>

  <select id="getCategory" resultMap="result">
    select catid, name, descn from category where catid = #value#
  </select>

  <select id="getCategoryList" resultMap="result">
    select catid, name, descn from category
  </select>

</sqlMap>
