반응형
250x250
Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
Tags
- Jenkins
- codepipeline
- node
- codedeploy error
- codedeploy
- PostgreSQL
- Spring Error
- Kafka
- chartjs
- java bigdecimal
- aws cicd
- aws
- IntelliJ
- Airflow
- JavaScript
- bootstrap
- openlens
- AWS CI/CD 구축하기
- VPN
- Spring
- kubeflow
- 도커
- codebuild
- redis
- chart.js
- docker
- COALESCE
- Flux
- SQL
- Python
Archives
- Today
- Total
Small Asteroid Blog
Querydsl like, contains 차이 본문
728x90
Querydsl의 like로 코드를 작성하고 확인해보니 컬럼의 풀텍스트가 일치하는 것만 출력이 된다. 앞뒤로 %를 붙이니 부분 텍스트만 입력해도 일치하는 것으로 리스트가 출력된다. contains는 어떨까 싶어서 확인해보니 %를 넣지 않아도 like에다가 %를 앞뒤로 붙인 것과 같은 결과가 출력된다.
query = query.where(UserEntity.name.like(userName));
//지정된 str(userName)과 같으면 return
query = query.where(UserEntity.name.contains(userName));
//지정된 str(userName)이 포함되는 경우 true를 return
728x90
반응형
'백엔드 > Spring' 카테고리의 다른 글
| [spring] Page 1 of 1 containing UNKNOWN instances (0) | 2021.09.06 |
|---|---|
| PageRequest - PageableDefault 설정 변경 (0) | 2021.09.06 |
| [spring] Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true (0) | 2021.08.24 |
| HttpURLConnection HttpsURLConnection구분 (0) | 2021.08.20 |
| [CSS] Uncaught SyntaxError: Unexpected token '{' (0) | 2021.08.10 |