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;
import org.springframework.data.repository.query.Param;

public interface StoryArcRepository extends JpaRepository<StoryArc, String> {
    @Query("select s from StoryArc s " +
            "where lower(s.name) like lower(concat('%', :searchTerm, '%')) ")
    List<StoryArc> search(@Param("searchTerm") String searchTerm);

    StoryArc findByNameAndComic(String name, Comic comic);

    List<StoryArc> findByComic(Comic comic);
}
