Package org.localify.repositories
Interface FestivalUserRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<FestivalUser,,FestivalUser.Key> org.springframework.data.jpa.repository.JpaRepository<FestivalUser,,FestivalUser.Key> org.springframework.data.repository.ListCrudRepository<FestivalUser,,FestivalUser.Key> org.springframework.data.repository.ListPagingAndSortingRepository<FestivalUser,,FestivalUser.Key> org.springframework.data.repository.PagingAndSortingRepository<FestivalUser,,FestivalUser.Key> org.springframework.data.repository.query.QueryByExampleExecutor<FestivalUser>,org.springframework.data.repository.Repository<FestivalUser,FestivalUser.Key>
public interface FestivalUserRepository
extends org.springframework.data.jpa.repository.JpaRepository<FestivalUser,FestivalUser.Key>
Repository for
FestivalUser entities.-
Method Summary
Modifier and TypeMethodDescriptionfindByKeyFestivalIdAndKeyUserId(UUID festivalId, UUID userId) Finds a festival-user relationship by festival ID and user ID.findByKeyUserId(UUID userId) Finds all festival-user relationships for a user, ordered by selected time.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
-
findByKeyFestivalIdAndKeyUserId
Finds a festival-user relationship by festival ID and user ID.- Parameters:
festivalId- The ID of the festival.userId- The ID of the user.- Returns:
- An optional containing the festival-user relationship if found, otherwise empty.
-
findByKeyUserId
@Query("select fu from FestivalUser fu where fu.key.userId = :userId order by fu.selectedAt desc") List<FestivalUser> findByKeyUserId(UUID userId) Finds all festival-user relationships for a user, ordered by selected time.- Parameters:
userId- The ID of the user.- Returns:
- A list of festival-user relationships.
-