Interface WhiteListDestinationRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<WhiteListDestination,,Integer> org.springframework.data.repository.Repository<WhiteListDestination,Integer>
@Repository
public interface WhiteListDestinationRepository
extends org.springframework.data.repository.CrudRepository<WhiteListDestination,Integer>
Spring Data repository used to access the destinations whitelist. See
WhiteListDestination.-
Method Summary
Modifier and TypeMethodDescriptionfindByEmail(String address) Find WhiteListDestination by address.findByName(String name) Find WhiteListDestination by name.findByNameAndUserId(String name, String userId) Find WhiteListDestination by name and user id.findByUserId(String userId) Find WhiteListDestination by user id.Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findAll, findAllById, findById, save, saveAll
-
Method Details
-
findByName
@Query(nativeQuery=true, value="SELECT w.* FROM destination_whitelist w WHERE w.name = :name") WhiteListDestination findByName(@Param("name") String name) Find WhiteListDestination by name.- Parameters:
name- WhiteListDestination- Returns:
- The WhiteListDestination
-
findByNameAndUserId
@Query(nativeQuery=true, value="SELECT w.* FROM destination_whitelist w WHERE w.name = :name and w.user_id = :userId") WhiteListDestination findByNameAndUserId(@Param("name") String name, @Param("userId") String userId) Find WhiteListDestination by name and user id.- Parameters:
name- WhiteListDestinationuserId- User identification- Returns:
- The WhiteListDestination
-
findByEmail
@Query(nativeQuery=true, value="SELECT w.* FROM destination_whitelist w WHERE w.address = :address") WhiteListDestination findByEmail(@Param("address") String address) Find WhiteListDestination by address.- Parameters:
address- WhiteListDestination- Returns:
- The WhiteListDestination
-
findByUserId
@Query(nativeQuery=true, value="SELECT w.* FROM destination_whitelist w WHERE w.user_id = :userId") List<WhiteListDestination> findByUserId(@Param("userId") String userId) Find WhiteListDestination by user id.- Parameters:
userId- user id- Returns:
- The WhiteListDestination
-