Skip to content
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

[Fix/286] countUnreadChats 메소드의 lastViewDate 비교 쿼리 수정 #287

Merged
merged 1 commit into from
Oct 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.querydsl.core.types.dsl.BooleanExpression;
import com.querydsl.jpa.JPAExpressions;
import com.querydsl.jpa.impl.JPAQueryFactory;
import java.time.LocalDateTime;
import java.util.Collections;
import java.util.List;
import lombok.RequiredArgsConstructor;
Expand Down Expand Up @@ -131,8 +132,9 @@ public Slice<Chat> findChatsByCursor(Long cursor, Long chatroomId, Long memberCh
//--- BooleanExpression ---//
private BooleanExpression createdAtGreaterThanLastViewDateSubQuery(Long memberChatroomId) {
return chat.createdAt.gt(
JPAExpressions.select(memberChatroom.lastViewDate)
.from(memberChatroom)
JPAExpressions.select(
memberChatroom.lastViewDate.coalesce(LocalDateTime.MIN)
).from(memberChatroom)
.where(memberChatroom.id.eq(memberChatroomId))
);
}
Expand Down
Loading