-
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
짧은 리뷰 조회 수정 #93 #101
짧은 리뷰 조회 수정 #93 #101
Conversation
get 매핑 중복으로 인해 짧은 리뷰 조회 시 매핑값 animes 추가, 짧은 리뷰 수정 메소드 추가
has -> is 변경, impl cursorCondition score 부분 else부분 수정
테스트를 통과하지 않아서 보니까 from ShortReview shortReview
inner join Member member1 with member1.id = shortReview.member.id
inner join Anime anime with anime.id = shortReview.anime.id
left join ShortReviewLike shortReviewLike with shortReview.id = shortReviewLike.shortReview.id
left join StarRating starRating with starRating.anime.id = shortReview.anime.id and starRating.member.id = shortReview.member.id
where anime.id = ?1
group by shortReview.id, member1.id
order by shortReviewLike.likeCount desc, shortReview.createdAt desc]
...
Caused by: org.hibernate.query.SemanticException: Could not resolve attribute 'likeCount' of 'io.oduck.api.domain.reviewLike.entity.ShortReviewLike' 이런 예외 메세지가 있었습니다. order by 부분에 public class ShortReviewLike extends BaseEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "short_review_id")
private ShortReview shortReview;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "member_id")
private Member member;
} 엔티티에 |
@@ -91,12 +95,12 @@ private BooleanExpression cursorCondition(String cursor, Pageable pageable){ | |||
|
|||
if(direction == Direction.ASC) { | |||
return starRating.score.gt(score) | |||
.or(starRating.score.goe(score).and(shortReview.createdAt.lt(scoreCreateAt)))//조회할 좋아요가 크거나 같으면, 첫 커서의 날짜가 크면 | |||
.or(starRating.score.goe(score).and(shortReview.createdAt.lt(scoreCreateAt))) | |||
.or(starRating.score.isNotNull().and(shortReview.createdAt.lt(scoreCreateAt))); |
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.
네 이해했습니다!
likeCount도 isNull로 바꾸셔야 합니다~ |
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.
🚀
📝 개요
짧은 리뷰 조회 수정
🚀 변경사항
🔗 관련 이슈
#93
➕ 기타