-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat : QueryDslUtil 및 무한 스크롤 적용 #276
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
굿굿~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
반영해서 무한 스크롤 방식 리팩토링 진행할게요
host.hostUsers.contains(hostUser), | ||
lastIdLessThanEqual(lastId)) | ||
.orderBy(orders) | ||
.limit(pageable.getPageSize() + 1) | ||
.fetch(); | ||
|
||
return checkLastPage(comments, pageable); | ||
} | ||
|
||
private BooleanExpression lastIdLessThanEqual(Long lastId) { | ||
return lastId == null ? null : host.id.loe(lastId); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이거보니깐 last Id방식은
필터링만 가능해야할듯 싶긴하네유
orderBy 가 역순이고..?
다른순으로 순서 바꾸면 라스트 아이디가 동작을 안하니..?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이거보니깐 last Id방식은 필터링만 가능해야할듯 싶긴하네유 orderBy 가 역순이고..? 다른순으로 순서 바꾸면 라스트 아이디가 동작을 안하니..?
소팅된 리스트에서 last id 다음거 가져오니 상관없지 않을까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
흐음 궁금하긴하네유
근데 생각해보니 될것같긴해유!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
흐음 궁금하긴하네유 근데 생각해보니 될것같긴해유!
오프셋 기반이 아니라 제대로 동작을 안하네요 오프셋으로 변경합니당
|
||
private BooleanExpression lastIdLessThanEqual(Long lastId) { | ||
return lastId == null ? null : host.id.loe(lastId); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
레스 댄이 맞지않나? 싶기도 하네유
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
레스 댄이 맞지않나? 싶기도 하네유
저도용
Kudos, SonarCloud Quality Gate passed! 0 Bugs |
개요
작업사항
사용은
sliceParam.toPageable()
메소드로 repository 에 적용해주면 됩니다QueryDsl Order By 적용을 위한 QueryDslUtil 구현
변경로직