mybatis 에서 like 쓰기
2020. 6. 7. 15:02ㆍ프로젝트/Spring
mybatis Doc 에 like 를 치면 나오긴 하지만, 이는 oracle 기준이라, mysql에서 쓰면 먹히질 않는다.
https://mybatis.org/mybatis-3/java-api.html
mybatis – MyBatis 3 | Java API
Java API Now that you know how to configure MyBatis and create mappings, you're ready for the good stuff. The MyBatis Java API is where you get to reap the rewards of your efforts. As you'll see, compared to JDBC, MyBatis greatly simplifies your code and k
mybatis.org
하지만, 운이 좋게도 DB 별로 정리해주신 분이 있어서 편하게 했다.
mysql 에서는
WHERE(AND) column LIKE CONCAT('%',#{name},'%')
출처: https://roqkffhwk.tistory.com/128 [야근싫어하는 개발자]
'프로젝트 > Spring' 카테고리의 다른 글
jquery function(함수) 만드는 법 (0) | 2020.06.15 |
---|---|
mybatis 3.0부터는 daoimpl이 필요가 없다. (1) | 2020.06.01 |
mybatis xml 에서 sql에 >,& 를 사용하는 방법 (0) | 2020.06.01 |