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 Type
    Method
    Description
     
    org.springframework.data.domain.Page<Announcement>
    findByCommonsId(Long commonsId, 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

    • findByCommonsId

      @Query("SELECT ann FROM announcement ann WHERE ann.commonsId = :commonsId AND (ann.endDate IS NULL OR ann.endDate > CURRENT_DATE)") org.springframework.data.domain.Page<Announcement> findByCommonsId(Long commonsId, org.springframework.data.domain.Pageable pageable)
    • findByAnnouncementId

      @Query("SELECT ann FROM announcement ann WHERE ann.id = :id") Optional<Announcement> findByAnnouncementId(Long id)