본문 바로가기

JAVA/JPA

queryDSL case When, decode

728x90

 

new CaseBuilder()

.when(~)

.then(~)

.otherwise()

.as(~)

 

new CaseBuilder()

.when(pointEvent.pointStatus.in(PointStatus.USE, PointStatus.USE_CANCEL))

.then(pointEvent.pointAmount.multiply(-1))

.otherwise(pointEvent.pointAmount).as("pointAmount")

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

JPA vs mybatis  (0) 2024.05.09
queryDSL JOIN  (0) 2021.01.15