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>
-
Method Summary
Modifier and TypeMethodDescriptionbooleanexistsByEmail(String email) Query per controllare se esiste un Utente tramite l' email.booleanexistsByIdUtente(Long idUtente) Query per controllare se esiste un Utente tramite l' id.booleanexistsByUsername(String username) Query per controllare se esiste un Utente tramite l' username.findByEmail(String email) Query per trovare un Utente tramite l' email.findByIdUtente(Long idUtente) Query per trovare un Utente tramite l' id.findByUsername(String username) Query per trovare un Utente tramite l' username.findByUsernameOrEmail(String username, String email) 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, saveMethods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlushMethods inherited from interface org.springframework.data.repository.ListCrudRepository
findAll, findAllById, saveAllMethods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor
count, exists, findAll, findBy, findOne
-
Method Details
-
findByUsernameOrEmail
Query per trovare un Utente tramite Username o Email.- Parameters:
username- Username dell' utenteemail- Email dell' utente- Returns:
- Utente
-
existsByIdUtente
Query per controllare se esiste un Utente tramite l' id.- Parameters:
idUtente- Id dell' utente- Returns:
- boolean
-
existsByUsername
Query per controllare se esiste un Utente tramite l' username.- Parameters:
username- Username dell' utente- Returns:
- boolean
-
existsByEmail
Query per controllare se esiste un Utente tramite l' email.- Parameters:
email- Email dell' utente- Returns:
- boolean
-
findByUsername
Query per trovare un Utente tramite l' username.- Parameters:
username- Username dell' utente- Returns:
- Utente
-
findByEmail
Query per trovare un Utente tramite l' email.- Parameters:
email- Email dell' utente- Returns:
- Utente
-
findByIdUtente
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'utenteidqDistance- Distanza tra gli indici di qualità- Returns:
- Lista di utenti
-