Interface ArtistEventRepository

All Superinterfaces:
org.springframework.data.repository.CrudRepository<ArtistEvent,ArtistEvent.Key>, org.springframework.data.repository.Repository<ArtistEvent,ArtistEvent.Key>

public interface ArtistEventRepository extends org.springframework.data.repository.CrudRepository<ArtistEvent,ArtistEvent.Key>
Repository for ArtistEvent entities.
  • Method Details

    • findByArtistAndEvent

      Optional<ArtistEvent> findByArtistAndEvent(Artist artist, Event event)
      Finds an artist-event relationship by artist and event.
      Parameters:
      artist - The artist.
      event - The event.
      Returns:
      An optional containing the artist-event relationship if found, otherwise empty.
    • findByArtistIdAndEventId

      ArtistEvent findByArtistIdAndEventId(UUID artistId, UUID eventId)
      Finds an artist-event relationship by artist ID and event ID.
      Parameters:
      artistId - The ID of the artist.
      eventId - The ID of the event.
      Returns:
      The artist-event relationship.
    • addArtistEvent

      @Modifying @Query(value="insert into artist_events (artist_id, event_id) values (:artistId, :eventId) on conflict do nothing", nativeQuery=true) void addArtistEvent(UUID artistId, UUID eventId)
      Adds a new artist-event relationship.
      Parameters:
      artistId - The ID of the artist.
      eventId - The ID of the event.
    • findByVenueId

      @Query("select ae from ArtistEvent ae where ae.event.venue.id = :venueId and ae.event.startTime > :after") List<ArtistEvent> findByVenueId(UUID venueId, Instant after)
      Finds all artist-event relationships for a venue after a certain time.
      Parameters:
      venueId - The ID of the venue.
      after - The timestamp to search after.
      Returns:
      A list of artist-event relationships.
    • countArtistsByEventStartTimeAfter

      @Async @Query("select count(distinct ae.artist) from ArtistEvent ae where ae.event.startTime >= :startTime") CompletableFuture<Integer> countArtistsByEventStartTimeAfter(Instant startTime)
      Counts the number of distinct artists with events after a certain time.
      Parameters:
      startTime - The timestamp to search after.
      Returns:
      A completable future containing the number of artists.
    • findAllByEventId

      List<ArtistEvent> findAllByEventId(UUID eventId)
      Finds all artist-event relationships for an event.
      Parameters:
      eventId - The ID of the event.
      Returns:
      A list of artist-event relationships.