@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 동적 요소
< dynamic>
-속성
prepend - 속성값을 요소 내용의 가장 앞에 붙인다
open - 요소내용의 접두사 prepend보다 뒤에 붙는다
close - 접미사
@이항연산 동적요소
< isEqual> - 프로퍼티 속성값이 compareProperty값이나 compareValue값과 같은지 검사
< isNotEqual> - ~~ 같지않은지 검사
< isGreaterThan> - 프로터티속성값이 compareProperty값이나 compareValue값보다 큰지 검사
< isGreaterEqual> ~~ 크거나 같은지 검사
< isLessThan> - ~~ 적은지 검사
< isLessEqual> - ~~ 작거나 같은지 검사
- 속성
property - 비교하는데 사용할 파라미터 프로퍼티
prepend -
open -
close -
removeFirstPrepend - 처음으로 내용을 출력하는 자식 요소의 prepend 속성 값을 출력할지 여부를 결정한다.
compareProperty - 비교할 파라미터 프로퍼티를 명시
compareValue - 프로퍼티속성에 명명된 프로퍼티와 비교할 정적인 비교값
예)
< select id="aaa">
select * from aaa
< isGreaterEqual property="weight" compareValue="100">
type='AAA'
< /isGreaterEqual>
< isLessThan property="weight" compareValue="100">
type='BBB'
< /isLessThan>
< /select>
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@단항연산 요소
< isPropertyAvailable> - 명시된 프로퍼티가 파라미터에 존재하는지 검사. 빈즈에서는 프로퍼티를 맵에서는 키를 찾는다
< isNotPropertyAvailable> - ~~ 존재하지않는지 검사.
< isNull> - 프로퍼티가 널인지 검사
< isNotNull> - 널이 아닌지 검사
< isEmpty> - 널인지 빈문자열인지 검사
< isNotEmpty> - ~~아닌지 검사
- 속성
property - 상대비교를 위해 사용되는 파라미터의 변수명
prepend
open
close
removeFirstPrepend
예)
< select id="aaa" >
select & from product
< dynamic prepend="where">
< isNotEmpty property="productType">
Type = #productType#
< /isNotEmpty>
< /dynamic>
< /select>
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@파라미터 요소
< isParameterPresent> - 파라미터 객체가 존재하는지 평가
< isNotParameterPresent> - 파라미터 객체가 존재하지 않는지 평가
예)
select * from product
< isParameterPresent prepend="where ">
< isNotEmpty property="productType">
Type = #productType#
< /isNotEmpty>
< /isParameterPresent>
@반복 요소
< iterate>
- 속성
conjunction - 값 목록의 사이 사이에 출려될 문장을 구성
예)
select * from product
< dynamic prepend="where productType in" >
< iterate property="productType" open="(" close=")" conjunction=",">
productType=#productTypes[]#
< /iterate>
< /dynamic>
'SQL > IBATIS' 카테고리의 다른 글
ibatis에서 or절 사용하기 (0) | 2014.04.12 |
---|---|
ibatis Boolean 사용법 (0) | 2014.04.12 |
동적쿼리 예제 isGreater, isNull,isEmpty 등 (0) | 2014.04.12 |
ibatis 글자수로 조건 줄때 (0) | 2014.04.12 |
ibatis 동적 쿼리 예제 (0) | 2014.03.25 |
dynamic 태그, isParameterPresent, removeFirstPrepend 설명 (0) | 2014.03.25 |
조회수 증가 쿼리(ibatis) (0) | 2014.02.19 |
[iBatis] iBatis 에서 Dynamic Mapped Statement 사용시 문제 (0) | 2014.02.19 |