Interface UtenteRepository

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

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

    Modifier and Type
    Method
    Description
    boolean
    Query per controllare se esiste un Utente tramite l' email.
    boolean
    Query per controllare se esiste un Utente tramite l' id.
    boolean
    Query per controllare se esiste un Utente tramite l' username.
    Query per trovare un Utente tramite l' email.
    findByIdUtente(Long idUtente)
    Query per trovare un Utente tramite l' id.
    Query per trovare un Utente tramite l' username.
    Query per trovare un Utente tramite Username o Email.
    findUtentiByIdLuogoPreferito(Long idLuogo, int idqDistance)
    Query personalizzata per restituire una lista di utenti che hanno salvato un luogo e le cui notifiche sono attive, in base a quanto sono distanti gli indici di qualità tra il luogo salvato e il luogo in generale.

    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

    • findByUsernameOrEmail

      Utente findByUsernameOrEmail(String username, String email)
      Query per trovare un Utente tramite Username o Email.
      Parameters:
      username - Username dell' utente
      email - Email dell' utente
      Returns:
      Utente
    • existsByIdUtente

      boolean existsByIdUtente(Long idUtente)
      Query per controllare se esiste un Utente tramite l' id.
      Parameters:
      idUtente - Id dell' utente
      Returns:
      boolean
    • existsByUsername

      boolean existsByUsername(String username)
      Query per controllare se esiste un Utente tramite l' username.
      Parameters:
      username - Username dell' utente
      Returns:
      boolean
    • existsByEmail

      boolean existsByEmail(String email)
      Query per controllare se esiste un Utente tramite l' email.
      Parameters:
      email - Email dell' utente
      Returns:
      boolean
    • findByUsername

      Utente findByUsername(String username)
      Query per trovare un Utente tramite l' username.
      Parameters:
      username - Username dell' utente
      Returns:
      Utente
    • findByEmail

      Utente findByEmail(String email)
      Query per trovare un Utente tramite l' email.
      Parameters:
      email - Email dell' utente
      Returns:
      Utente
    • findByIdUtente

      Utente findByIdUtente(Long idUtente)
      Query per trovare un Utente tramite l' id.
      Parameters:
      idUtente - Id dell' utente
      Returns:
      Utente
    • findUtentiByIdLuogoPreferito

      @Query("SELECT u FROM Utente u INNER JOIN Preferenze pref ON u.idUtente=pref.idUtente INNER JOIN Preferiti p ON u.idUtente=p.idPreferiti.idUtente INNER JOIN Luogo l ON p.idPreferiti.idLuogo = l.idLuogo WHERE pref.notifiche=true AND p.notifiche=true AND p.idPreferiti.idLuogo=?1 AND ABS(p.qualityIndex - l.qualityIndex)>?2") List<Utente> findUtentiByIdLuogoPreferito(Long idLuogo, int idqDistance)
      Query personalizzata per restituire una lista di utenti che hanno salvato un luogo e le cui notifiche sono attive, in base a quanto sono distanti gli indici di qualità tra il luogo salvato e il luogo in generale.
      Parameters:
      idLuogo - Id del Luogo salvato dall'utente
      idqDistance - Distanza tra gli indici di qualità
      Returns:
      Lista di utenti