블로그 이미지
헤이장

Notice

Recent Post

Recent Comment

Recent Trackback

calendar

1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
  • total
  • today
  • yesterday
2009. 7. 27. 20:21 Web/Framework


<select id="getCategory_No" resultClass="vo.Category">
        select * from category where no = #value#
</select>

<select id="getCategory_No" parameterClass="int" resultClass="vo.Category">
        select * from category where no = #value#
</select>

두가지 경우는 동일한 결과를 보인다
parameterClass 가 VO 객체일 경우에도 동일하다
실제로 ibatis 교재에는 parameterClass 로 xml 을 받는 경우를 제외하고 대부분 parameterClass 를 선언하지 않고 있다

※ parameterClass 에 선언을 하지 않으면 - 어떤 파라메터도 전달이 된다
※ parameterClass 에 선언을 하면 - 그 자료형이 아니면 SQL예외처리가 발생한다

 parameterClass 를 선언해 주는 것이 잘못된 자료형이 전달되는 것을 미리 막아주는 것 같다

posted by 헤이장