Interface UserRecommendationRepository

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

public interface UserRecommendationRepository extends org.springframework.data.jpa.repository.JpaRepository<UserRecommendation,UUID>
Repository for UserRecommendation entities.
  • Method Summary

    Modifier and Type
    Method
    Description
    Counts the number of user recommendations created between two timestamps.
    Finds a list of user recommendations for a user and city, created after a certain time, ordered by creation date.
    Finds the most recently created user recommendation.

    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

    • findByUserIdAndCityIdAndCreatedAtAfterOrderByCreatedAtDesc

      List<UserRecommendation> findByUserIdAndCityIdAndCreatedAtAfterOrderByCreatedAtDesc(UUID userId, UUID cityId, Instant createdAt)
      Finds a list of user recommendations for a user and city, created after a certain time, ordered by creation date.
      Parameters:
      userId - The ID of the user.
      cityId - The ID of the city.
      createdAt - The timestamp to check against.
      Returns:
      A list of user recommendations.
    • countByCreatedAtBetween

      @Async CompletableFuture<Long> countByCreatedAtBetween(Instant start, Instant end)
      Counts the number of user recommendations created between two timestamps.
      Parameters:
      start - The start timestamp.
      end - The end timestamp.
      Returns:
      A completable future containing the number of recommendations.
    • findTopByOrderByCreatedAt

      UserRecommendation findTopByOrderByCreatedAt()
      Finds the most recently created user recommendation.
      Returns:
      The user recommendation.