SQL Mapping
<parameterMap class="map" id="getJobDescParam">
<parameter property="p_job_code" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
</parameterMap>
<select id="getJobDesc" parameterMap="getJobDescParam" resultClass="java.lang.String">
select hr_util.get_job_desc(?) from dual
</select>
Contoh kod DAO
public String getJobDesc(String jobCode)
{
String returnString;
Map<String, Object> map = new HashMap<String, Object>();
map.put("p_job_code", jobCode);
// Reference com.icms.biz.dao.ibatis.maps.StaffMain.xml
returnString = (String)getSqlMapClientTemplate().queryForObject("getJobDesc",map);
if(StringUtils.isEmpty(returnString)){
returnString = "-";
}
return returnString;
}