Package org.localify.repositories
Interface FestivalStageRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<FestivalStage,,UUID> org.springframework.data.jpa.repository.JpaRepository<FestivalStage,,UUID> org.springframework.data.repository.ListCrudRepository<FestivalStage,,UUID> org.springframework.data.repository.ListPagingAndSortingRepository<FestivalStage,,UUID> org.springframework.data.repository.PagingAndSortingRepository<FestivalStage,,UUID> org.springframework.data.repository.query.QueryByExampleExecutor<FestivalStage>,org.springframework.data.repository.Repository<FestivalStage,UUID>
public interface FestivalStageRepository
extends org.springframework.data.jpa.repository.JpaRepository<FestivalStage,UUID>
Repository for
FestivalStage entities.-
Method Summary
Modifier and TypeMethodDescriptioncountByFestivalId(UUID festivalId) Counts the number of stages for a festival.voiddeleteByFestivalId(UUID festivalId) Deletes all stages for a festival.findByFestivalId(UUID festivalId) Finds all stages for a festival.findByNameAndFestivalId(String name, UUID festivalId) Finds a festival stage by name and festival ID.findWithNoPerformances(UUID festivalId) Finds all stages for a festival that have no performances.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
-
findByNameAndFestivalId
Finds a festival stage by name and festival ID.- Parameters:
name- The name of the stage.festivalId- The ID of the festival.- Returns:
- An optional containing the festival stage if found, otherwise empty.
-
countByFestivalId
Counts the number of stages for a festival.- Parameters:
festivalId- The ID of the festival.- Returns:
- The number of stages.
-
deleteByFestivalId
@Transactional @Modifying @Query("delete from FestivalStage fs where fs.festival.id = :festivalId") void deleteByFestivalId(UUID festivalId) Deletes all stages for a festival.- Parameters:
festivalId- The ID of the festival.
-
findByFestivalId
Finds all stages for a festival.- Parameters:
festivalId- The ID of the festival.- Returns:
- A list of festival stages.
-
findWithNoPerformances
@Query(" select fs\n from FestivalStage fs\n where fs.festival.id = :festivalId\n and not exists (\n select 1\n from FestivalPerformance fp\n where fp.stage.id = fs.id\n )\n") List<FestivalStage> findWithNoPerformances(UUID festivalId) Finds all stages for a festival that have no performances.- Parameters:
festivalId- The ID of the festival.- Returns:
- A list of festival stages.
-