Interface UserCountryRepository

All Superinterfaces:
org.springframework.data.repository.CrudRepository<UserCountry,UserCountryPK>, org.springframework.data.jpa.repository.JpaRepository<UserCountry,UserCountryPK>, org.springframework.data.repository.PagingAndSortingRepository<UserCountry,UserCountryPK>, org.springframework.data.repository.query.QueryByExampleExecutor<UserCountry>, org.springframework.data.repository.Repository<UserCountry,UserCountryPK>

public interface UserCountryRepository extends org.springframework.data.jpa.repository.JpaRepository<UserCountry,UserCountryPK>
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
     
    boolean
     
    boolean
     

    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, findAll, findAll, findAllById, flush, getById, getOne, saveAll, saveAllAndFlush, saveAndFlush

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

    findAll

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

    count, exists, findAll, findOne
  • Method Details

    • deleteByEmail

      void deleteByEmail(String email)
    • getCountriesForUser

      @Query(value="select country from user_countries where email = ?1", nativeQuery=true) List<String> getCountriesForUser(String email)
    • verifyAuthorizationForId

      @Query(value="select count(o.country) > 0 from organizations o left outer join user_countries uc on (o.country = uc.country) where o.id = ?1 and uc.email = ?2", nativeQuery=true) boolean verifyAuthorizationForId(String id, String user)
    • verifyAuthorizationForCountry

      @Query(value="select count(country) > 0 from user_countries where country = ?1 and email = ?2", nativeQuery=true) boolean verifyAuthorizationForCountry(String country, String user)