Interface PhotoRepository

  • All Superinterfaces:
    org.springframework.data.repository.CrudRepository<Photo,​Long>, org.springframework.data.jpa.repository.JpaRepository<Photo,​Long>, org.springframework.data.repository.PagingAndSortingRepository<Photo,​Long>, org.springframework.data.repository.query.QueryByExampleExecutor<Photo>, org.springframework.data.repository.Repository<Photo,​Long>

    public interface PhotoRepository
    extends org.springframework.data.jpa.repository.JpaRepository<Photo,​Long>
    This interface extends JpaRepository. This interface handles searching for photos using different parameters including id, Event, uploaded, and location.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      Optional<Photo> findPhotoByLatitudeAndLongitude​(Double latitude, Double longitude)
      Finds a photo using the location of where a photo was taken.
      Optional<Photo> findPhotosByUploaded​(Date uploaded)
      Finds a Photo by the the time stamp that is created when a photo is uploaded.
      List<Photo> findPhotosByUser​(User user)
      Finds the photos that are associated with a user.
      • Methods inherited from interface org.springframework.data.repository.CrudRepository

        count, delete, deleteAll, deleteAll, deleteById, existsById, findById, save
      • Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository

        deleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAll, findAllById, flush, getOne, saveAll, 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 Detail

      • findPhotosByUser

        List<Photo> findPhotosByUser​(User user)
        Finds the photos that are associated with a user.
        Parameters:
        user - The user that took the photo.
        Returns:
        A collection of photos associated with a specific user.
      • findPhotosByUploaded

        Optional<Photo> findPhotosByUploaded​(Date uploaded)
        Finds a Photo by the the time stamp that is created when a photo is uploaded.
        Parameters:
        uploaded - Time stamp of when a photo is uploaded,
        Returns:
        A photo.
      • findPhotoByLatitudeAndLongitude

        Optional<Photo> findPhotoByLatitudeAndLongitude​(Double latitude,
                                                        Double longitude)
        Finds a photo using the location of where a photo was taken.
        Parameters:
        latitude - part of the coordinates of where a photo was taken.
        longitude - part of the coordinates of where a photo was taken.
        Returns:
        A photo that was taken in a specific location.