Package org.localify.repositories
Interface PlaylistSongPairRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<PlaylistSongPair,,UUID> org.springframework.data.jpa.repository.JpaRepository<PlaylistSongPair,,UUID> org.springframework.data.repository.ListCrudRepository<PlaylistSongPair,,UUID> org.springframework.data.repository.ListPagingAndSortingRepository<PlaylistSongPair,,UUID> org.springframework.data.repository.PagingAndSortingRepository<PlaylistSongPair,,UUID> org.springframework.data.repository.query.QueryByExampleExecutor<PlaylistSongPair>,org.springframework.data.repository.Repository<PlaylistSongPair,UUID>
public interface PlaylistSongPairRepository
extends org.springframework.data.jpa.repository.JpaRepository<PlaylistSongPair,UUID>
Repository for
PlaylistSongPair entities.-
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteAllByPlaylistId(UUID playlistId) Deletes all playlist song pairs for a playlist.findAllByPlaylistId(UUID playlistId) Finds all playlist song pairs for a playlist.Finds all non-deleted playlist song pairs for a playlist, ordered by position.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
-
findAllByPlaylistId
Finds all playlist song pairs for a playlist.- Parameters:
playlistId- The ID of the playlist.- Returns:
- A list of playlist song pairs.
-
findAllByPlaylistIdAndDeletedAtNotNull
@Query("select psp from PlaylistSongPair psp\nwhere psp.playlist = :playlist and psp.deletedAt is null\norder by psp.position\n") List<PlaylistSongPair> findAllByPlaylistIdAndDeletedAtNotNull(Playlist playlist) Finds all non-deleted playlist song pairs for a playlist, ordered by position.- Parameters:
playlist- The playlist.- Returns:
- A list of playlist song pairs.
-
deleteAllByPlaylistId
Deletes all playlist song pairs for a playlist.- Parameters:
playlistId- The ID of the playlist.
-