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 Type
    Method
    Description
    countByFestivalId(UUID festivalId)
    Counts the number of stages for a festival.
    void
    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.
    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, 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

    • findByNameAndFestivalId

      Optional<FestivalStage> findByNameAndFestivalId(String name, UUID festivalId)
      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

      Integer countByFestivalId(UUID festivalId)
      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

      List<FestivalStage> findByFestivalId(UUID festivalId)
      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.