<insert id="saveCertification" parameterType="com.my.model.CertModel" useGeneratedKeys="true" keyProperty="id" >
INSERT INTO AAA
( USER_ID , AAA_ID , SIGN_DATE_TIME )
VALUES(
#{userId,jdbcType=VARCHAR},#{aaaId,jdbcType=DECIMAL},#{signDateTime,jdbcType=DECIMAL}
)
<selectKey keyProperty="certificationId" resultType="Long" order="AFTER">
SELECT SEQ_AAA_CERTIFICATION.currval FROM dual
</selectKey>
</insert>
-> 이렇게 되면 CertModel 에 certificationId에 값이 자동으로 저장되어 리턴됨.
댓글 없음:
댓글 쓰기