Package org.localify.repositories
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 TypeMethodDescriptioncountByCreatedAtBetween(Instant start, Instant end) Counts the number of user recommendations created between two timestamps.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.Finds the most recently created user recommendation.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
-
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
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.
-