-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fb35fb9
commit 8d1edff
Showing
2 changed files
with
24 additions
and
2 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
.../java/com/api/ttoklip/domain/newsletter/like/repository/NewsletterLikeRepositoryImpl.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,24 @@ | ||
package com.api.ttoklip.domain.newsletter.like.repository; | ||
|
||
import com.querydsl.core.types.dsl.Wildcard; | ||
import com.querydsl.jpa.impl.JPAQueryFactory; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
import static com.api.ttoklip.domain.newsletter.like.entity.QNewsletterLike.newsletterLike; | ||
|
||
|
||
@RequiredArgsConstructor | ||
public class NewsletterLikeRepositoryImpl implements NewsletterLikeRepositoryCustom { | ||
|
||
private final JPAQueryFactory jpaQueryFactory; | ||
|
||
@Override | ||
public Long countNewsletterLikesByNewsletterId(final Long newsletterId) { | ||
return jpaQueryFactory | ||
.select(Wildcard.count) | ||
.from(newsletterLike) | ||
.where(newsletterLike.newsletter.id.eq(newsletterId)) | ||
.fetchOne(); | ||
} | ||
|
||
} |
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