Interface NotificaRepository

All Superinterfaces:
org.springframework.data.repository.CrudRepository<Notifica,Long>, org.springframework.data.jpa.repository.JpaRepository<Notifica,Long>, org.springframework.data.repository.ListCrudRepository<Notifica,Long>, org.springframework.data.repository.ListPagingAndSortingRepository<Notifica,Long>, org.springframework.data.repository.PagingAndSortingRepository<Notifica,Long>, org.springframework.data.repository.query.QueryByExampleExecutor<Notifica>, org.springframework.data.repository.Repository<Notifica,Long>

@Repository public interface NotificaRepository extends org.springframework.data.jpa.repository.JpaRepository<Notifica,Long>
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Query per controllare se esiste una notifica con autore e testo specificati con la data di scadenza passata.
    boolean
    existsByIdNotifica(long idNotifica)
    Query per controllare se esiste una notifica tramite l'id.
    Query per trovare la lista notifiche inviate da un autore.
    findByIdNotifica(Long idNotifica)
    Query per trovare una Notifica usando il suo id.
    Query per trovare la notifica più recente tramite autore e testo (usato per i test).

    Methods inherited from interface org.springframework.data.repository.CrudRepository

    count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, save

    Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository

    deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlush

    Methods inherited from interface org.springframework.data.repository.ListCrudRepository

    findAll, findAllById, saveAll

    Methods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository

    findAll

    Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository

    findAll

    Methods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor

    count, exists, findAll, findBy, findOne
  • Method Details

    • findByIdNotifica

      Notifica findByIdNotifica(Long idNotifica)
      Query per trovare una Notifica usando il suo id.
      Parameters:
      idNotifica - Id della Notifica
      Returns:
      Notifica
    • findByAutore

      List<Notifica> findByAutore(String autore)
      Query per trovare la lista notifiche inviate da un autore.
      Parameters:
      autore - Autore della notifica
      Returns:
      Lista di notifiche
    • existsByIdNotifica

      boolean existsByIdNotifica(long idNotifica)
      Query per controllare se esiste una notifica tramite l'id.
      Parameters:
      idNotifica - Id della notifica
      Returns:
      boolean
    • findFirstByAutoreAndTestoOrderByDataInvioDesc

      Notifica findFirstByAutoreAndTestoOrderByDataInvioDesc(String autore, String testo)
      Query per trovare la notifica più recente tramite autore e testo (usato per i test).
      Parameters:
      autore - Autore della notifica
      testo - Testo della notifica
      Returns:
      Notifica
    • existsByAutoreAndTestoAndExpireDateAfter

      boolean existsByAutoreAndTestoAndExpireDateAfter(String autore, String testo, LocalDateTime localDateTime)
      Query per controllare se esiste una notifica con autore e testo specificati con la data di scadenza passata.
      Parameters:
      autore - Autore della notifica
      testo - Testo della notifica
      localDateTime - Data oltre cui non bisogna andare
      Returns:
      boolean