ChallengeParticipantRepository.java
561 bytes
| 1 | package com.tasteprint.social; |
|---|---|
| 2 | |
| 3 | import java.util.List; |
| 4 | import java.util.Optional; |
| 5 | import java.util.UUID; |
| 6 | |
| 7 | import org.springframework.data.jpa.repository.JpaRepository; |
| 8 | |
| 9 | interface ChallengeParticipantRepository extends JpaRepository<ChallengeParticipant, UUID> { |
| 10 | |
| 11 | List<ChallengeParticipant> findByUserId(UUID userId); |
| 12 | |
| 13 | List<ChallengeParticipant> findByChallengeId(UUID challengeId); |
| 14 | |
| 15 | boolean existsByChallengeIdAndUserId(UUID challengeId, UUID userId); |
| 16 | |
| 17 | Optional<ChallengeParticipant> findByChallengeIdAndUserId(UUID challengeId, UUID userId); |
| 18 | } |
| 19 | |