<select id="selectSearch" parameterType="java.util.HashMap"> 두개 이상의 파라미터를 받을때 , 모델클래스 규격에 안맞으면 해쉬맵 사용

        select * from board where 1 = 0

 <if test="title != null"> or title like '%${title}'</if>   ◀---해쉬맵에 들어있는 키값

 <if test="content != null"> or content like '%${content}%'</if>



<insert id="insertBoard" parameterType="board" useGeneratedKeys="true"keyProperty="num"

pk 컬럼에 해당하는 값을 자동으로 생성하고 , 그 결과를 파라미터로 넘어온 board객체의 num프로퍼티에 넣어주셈







??????? 오라클 경우, auto_increment없음

<selectKey keyProperty="num">

select b_seq.nextval from dual     

</selectKey>

' IOT 기반 응용 SW과정 > Web Programing' 카테고리의 다른 글

Day57 MyBatis_Spring  (0) 2016.06.09
Day56 MyBatis-Spring  (0) 2016.06.08
Day54 MyBatis_anno  (0) 2016.06.02
Day53 MyBatis  (0) 2016.06.01
Day52 jdbcTemplate // MyBatis  (0) 2016.05.31

+ Recent posts