[ibaitis] mysql select PROCEDURE ibatis
코드1)
- java
@Override
public List<Etraininglist> selectEtraininglistList(int code) throws Exception {
logger.debug("selectEtraininglistList -------------------------->> " + code);
Map<String, Object> condition = new HashMap<String, Object>();
condition.put("code", code);
return sqlMap.queryForList("member.selectEtraininglist", condition);
}
- ibatis
<parameterMap class="map" id="selParam">
<parameter property="code" jdbcType="INT" javaType="java.lang.Integer" mode="IN"/>
</parameterMap>
<procedure id="selectEtraininglist" parameterMap="selParam" resultClass="Etraininglist" >
<![CDATA[
{CALL USP_Interface_Member_GetEducationCourceByButton(?)}
]]>
</procedure>
코드2)
- java
@Override
public List<Etraininglist> selectEtraininglistList(int code) throws Exception {
logger.debug("selectEtraininglistList -------------------------->> " + code);
return sqlMap.queryForList("member.selectEtraininglist", code);
}
- ibatis
<procedure id="selectEtraininglist" parameterClass="java.lang.Integer" resultClass="Etraininglist" >
<![CDATA[
{CALL USP_Interface_Member_GetEducationCourceByButton(#code#)}
]]>
</procedure>
[ibaitis] mysql select PROCEDURE ibatis
'programming > ibatis mybatis' 카테고리의 다른 글
[mybatis] oracle insert 리턴값 받기 selectKey (0) | 2014.10.23 |
---|---|
[mybatis] function 호출하고 리턴값 받기 (0) | 2014.08.04 |
[ibatis] in 조건 생성하기 (0) | 2013.10.17 |
[ibatis] in 조건으로 delete 하기 (0) | 2013.10.02 |
[ibatis] delete sql in 사용 (0) | 2013.06.30 |