case 1) HashMap 형태
public void insertIntoImg(List<NeliVO> neliVoList) {
HashMap<String, Object> param = new HashMap<String, Object>();
param.put("List", neliVoList);
getSqlMapClientTemplate().insert(NAMESPACE + "insertIntoImg", param);
}
<insert id="insertIntoImg" parameterClass="java.util.HashMap">
INSERT INTO ADMINIMG (
BOARD_SEQ
, CONTENTS_PATH
, CONTENTS_NAME
, CONTENTS_ORI_NAME
, CONTENTS_TYPE
, TEXT1
, REG_DATE
)
<dynamic>
<iterate prepend="VALUES" conjunction=", " property="List">
(
#List[].seqId#
, #List[].path#
, #List[].fileName#
, #List[].oriFileName#
, #List[].contentsType#
, #List[].text1#
, now()
)
</iterate>
</dynamic>
</insert>
case 1) List 형태
<insert id="insertIntoImg" parameterClass="java.util.List">
INSERT INTO ADMINIMG (
BOARD_SEQ
, CONTENTS_PATH
, CONTENTS_NAME
, CONTENTS_ORI_NAME
, CONTENTS_TYPE
, TEXT1
, REG_DATE
) VALUES
<iterate conjunction=", ">
(
#[].seqId#
, #List[].path#
, #List[].fileName#
, #List[].oriFileName#
, #List[].contentsType#
, #List[].text1#
, now()
)
</iterate>
</insert>
'Database > MyBatis' 카테고리의 다른 글
[Procedure] ibatis 호출 (0) | 2015.02.12 |
---|---|
[Spring] Repository sqlMapClientTemplate 맵핑 (0) | 2014.08.03 |
org.springframework.dao.DataAccessResourceFailureException / RecoverableDataAccessException (0) | 2014.03.25 |
[iBatis] resultMap 할 시 값이 return 되지 않는 현상 (0) | 2013.02.25 |
[iBatis] resultMap, resultClass, parameterClass 에 관한 고찰 (0) | 2013.02.19 |