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

<sqlMap namespace="Customer">

  <resultMap id="result" class="org.springframework.batch.sample.domain.trade.CustomerCredit">
    <result property="name" column="NAME" />
    <result property="credit" column="CREDIT" />
  </resultMap>

  <select id="getAllCustomerCreditIds" resultClass="int">
    select ID from CUSTOMER
  </select>
  
  <select id="getAllCustomerCredits" resultMap="result">
 	select ID, NAME, CREDIT from CUSTOMER 
  </select>
  
  <select id="getCustomerCreditById" parameterClass="int" resultMap="result">
  	select NAME, CREDIT from CUSTOMER where ID = #value#
  </select>
  
  <update id="updateCredit" parameterClass="org.springframework.batch.sample.domain.trade.CustomerCredit" >
  	update CUSTOMER set CREDIT = #credit# where NAME = #name#
  </update>

</sqlMap>