Interface AnnouncementRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<Announcement, Long>, org.springframework.data.repository.Repository<Announcement, Long>
@Repository
public interface AnnouncementRepository
extends org.springframework.data.repository.CrudRepository<Announcement, Long>
-
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.data.domain.Page<Announcement> findByGameId(Long gameId, org.springframework.data.domain.Pageable pageable) org.springframework.data.domain.Page<Announcement> findCurrentByGameId(Long gameId, org.springframework.data.domain.Pageable pageable) Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findAll, findAllById, findById, save, saveAll
-
Method Details
-
findByGameId
@Query("SELECT ann FROM announcement ann WHERE ann.gameId = :gameId AND (ann.endDate IS NULL OR ann.endDate > CURRENT_TIMESTAMP)") org.springframework.data.domain.Page<Announcement> findByGameId(Long gameId, org.springframework.data.domain.Pageable pageable) -
findCurrentByGameId
@Query("SELECT ann FROM announcement ann WHERE ann.gameId = :gameId AND ann.startDate <= CURRENT_TIMESTAMP AND (ann.endDate IS NULL OR ann.endDate > CURRENT_TIMESTAMP)") org.springframework.data.domain.Page<Announcement> findCurrentByGameId(Long gameId, org.springframework.data.domain.Pageable pageable) -
findByAnnouncementId
@Query("SELECT ann FROM announcement ann WHERE ann.id = :id") Optional<Announcement> findByAnnouncementId(Long id)
-