Merged
Conversation
Jaeyeop-Jung
approved these changes
Feb 19, 2023
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
관련 이슈 번호
설명
모아보기에서 전체 레코드 개수를 확인할 수 있도록
전체 레코드 수를 반환하는 API 구현하였습니다.
카운트 쿼리를 최소화 하기위해 전체 레코드 수 조회 메서드에서 캐시를 적극 사용하였고,
데이터의 정합성을 위해 글 작성과 글 삭제 시 캐시를 비워주도록 하였습니다.
변경사항
질문사항
jpa 의 count 메서드가 primitive 타입인 long을 반환하도록 바뀐 것 같습니다.
RecordService.java getRecordAllCount 메소드의 반환값을 Wrapper로 설정하고, count쿼리의 결괏값을 boxing하여 return하도록 작성하였더니,
java.lang.ClassCastException가 발생합니다. 이유가 뭘까요...?