xml할 때 주의할 점

이태규·2022년 3월 30일
0

spring

목록 보기
31/64

select 에는 항상 result의 과정이 있다.
1. 컬럼명과 변수이름이 같고
2. 타입이 같을 경우 result의 과정을 생략할 수 있다.

만약 다르다면

    <resultMap id="result1" type="com.example.dto.ItemDTO">
        <!-- resultmap 이 있으면 셀렉으로 와서 리저트로 감 원래 셀렉은 리저트 맵이 있음. 
        1. select으로 온다. 2. resultmap에서 변환 3. 나감 -->
        <result column="ICODE" property="icode" />  
        <result column="IIMAGESIZE" property="iimagesize" />  
        <result column="IIMAGETYPE" property="iimagetype" />  
        <result column="IIMAGENAME" property="iimagename" />          
        <result column="IIMAGE" property="iimage" jdbcType="BLOB" />
    </resultMap>
profile
한 걸음씩 나아가자

0개의 댓글