Database
[MyBatis] 동적쿼리, 기타 문법
동적 SQL MyBatis를 사용하는 이유는 편리한 동적 SQL 기능 때문이다. 동적 쿼리를 위해 제공되는 기능은 아래와 같다. if choose(when, otherwise) where foreach MyBatis 공식 매뉴얼: https://mybatis.org/mybatis-3/ko/index.html MyBatis 스프링 공식 매뉴얼: https://mybatis.org/spring/ko/index.html if 단순한 if 문이다. if문의 test 조건에 만족하면 해당 SQL문을 추가한다. SELECT * FROM BLOG WHERE state = ‘ACTIVE’ AND title like #{title} choose - when, otherwise 자바의 switch 구문과 비슷하다. swi..