-
Notifications
You must be signed in to change notification settings - Fork 1
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
NABI-255--fix card list read with cursor paging #47
Merged
hi-june
merged 5 commits into
dev
from
NABI-255--junhyuk--fix--card-list-read-with-cursor-paging
Nov 18, 2023
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
515b5ff
NABI-255--feat : OrderSpecifier Util 클래스 추가
hi-june 069bf42
NABI-255--feat : 카드 도메인 다중 정렬 조건 추가
hi-june 61ecbd0
Merge remote-tracking branch 'origin/dev' into NABI-255--junhyuk--fix…
hi-june 91c9f19
Merge branch 'dev' into NABI-255--junhyuk--fix--card-list-read-with-c…
hi-june e7e1204
Merge branch 'dev' into NABI-255--junhyuk--fix--card-list-read-with-c…
hi-june File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/main/java/org/prgrms/nabimarketbe/global/util/QueryDslUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package org.prgrms.nabimarketbe.global.util; | ||
|
||
import com.querydsl.core.types.Order; | ||
import com.querydsl.core.types.OrderSpecifier; | ||
import com.querydsl.core.types.Path; | ||
import com.querydsl.core.types.dsl.Expressions; | ||
|
||
public class QueryDslUtil { | ||
/** | ||
* Order, Path, fieldName을 전달하면 OrderSpecifier 객체를 리턴하는 Util 클래스. | ||
* Sort시 마다 사용할 수 있도록 한다. | ||
* | ||
* @param order | ||
* @param parent compileQuerydsl 빌드를 통해서 생성된 Q타입 클래스의 객체(Sort의 대상이 되는 Q타입 클래스 객체를 전달한다.) | ||
* @param fieldName | ||
* @return OrderSpecifier 객체 | ||
*/ | ||
public static OrderSpecifier<?> getSortedColumn( | ||
Order order, | ||
Path<?> parent, | ||
String fieldName | ||
) { | ||
Path<Object> fieldPath = Expressions.path(Object.class, parent, fieldName); | ||
|
||
return new OrderSpecifier(order, fieldPath); | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
p1
해당 메소드는 제가 예상하기엔 커스텀 커서 페이징이 필요한 모든 곳에서 작성되어야 할 것 같은데요 !
QueryDslUtil의 static 메소드로 작성하지 않으신 이유가 있을까요 ?!
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.
추후에 따로 브랜치를 파서 커서 페이징 하는 모든 부분들을 통합해서 수정할 예정입니다.
공통으로 사용할 수 있는 부분들을 최대한 빼 볼 생각인데, 그 때 같이 넣어두겠습니다~