-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
5 changed files
with
42 additions
and
27 deletions.
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
6 changes: 6 additions & 0 deletions
6
src/main/java/zipdabang/server/repository/recipeRepositories/ScrapRepository.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 |
---|---|---|
@@ -1,13 +1,19 @@ | ||
package zipdabang.server.repository.recipeRepositories; | ||
|
||
import org.springframework.data.domain.Page; | ||
import org.springframework.data.domain.PageRequest; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Query; | ||
import org.springframework.data.repository.query.Param; | ||
import zipdabang.server.domain.member.Member; | ||
import zipdabang.server.domain.recipe.Recipe; | ||
import zipdabang.server.domain.recipe.Scrap; | ||
|
||
import java.util.Optional; | ||
|
||
public interface ScrapRepository extends JpaRepository<Scrap, Long> { | ||
@Query("select s.recipe from Scrap s where s.member = :owner and s.recipe.member not in ( select b.blocked from BlockedMember b where b.owner = :owner ) ") | ||
Page<Recipe> findRecipeByMember(@Param("owner") Member owner, PageRequest pageRequest); | ||
Optional<Scrap> findByRecipeAndMember(Recipe recipe, Member member); | ||
|
||
} |
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
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
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