공부
[MyBatis] CDATA 사용하기(feat.<> 괄호,특수문자 문자열로 인식하기)
승가비
2024. 10. 30. 08:23
728x90
https://java119.tistory.com/70
[MyBatis] CDATA 사용하기(feat.<> 괄호,특수문자 문자열로 인식하기)
CDATA ( ) 개념 쿼리를 작성할 때, '', '&'를 사용해야하는 경우가 생기는데 xml에서 그냥 사용할 경우 태그로 인식하는 경우가 종종 있다.. 이럴 경우 에러를 뱉어내기 때문에 '태그가 아니라 실제 쿼
java119.tistory.com
<select id="getUser" resultMap="UserVO"> <![CDATA[ select * from user where 1=1 ]]> <choose> <when test='id != null and user_type =="1"'> <![CDATA[ salary > 100 ]]> </when> <otherwise> <![CDATA[ salary < 100 ]]> </otherwise> </choose> </select>
728x90