package de.thpeetz.kontor.comics.repository;

import java.util.List;

import de.thpeetz.kontor.comics.data.*;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

public interface ComicWorkRepository extends JpaRepository<ComicWork, String> {

    @Query("SELECT c from ComicWork c where c.comic = ?1 and c.artist = ?2 and c.workType = ?3")
    ComicWork findbyComicAndArtistAndWorktype(Comic comic, Artist artist, Worktype worktype);

    @Query("select c from ComicWork c where c.comic = ?1")
    List<ComicWork> findByComic(Comic comic);
}
