JPA/queryDsl

QueryDsl between

lovineff 2023. 5. 30. 20:02

QueryDsl Between 사용 방법

// 값 설정
String yyyyMMdd = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMdd"));


// 다른부분 생략
jpaQueryFactory
.where(Expressions.asString(yyyyMMdd).between(entity.startDate, entity.endDate))


// 실행 결과
and ('20230530' between p010.START_DATE and p010.END_DATE)

 

'JPA > queryDsl' 카테고리의 다른 글

DB 함수 호출  (0) 2021.03.22
queryDsl 모듈별 빌드  (0) 2021.03.09
Filter 이름별 조건 설정 방법  (0) 2021.03.09
동적 쿼리 생성  (0) 2020.06.09
UPDATE, DELETE 문  (0) 2020.06.09