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 ArtistRepository extends JpaRepository<Artist, String> {
    @Query("select a from Artist a " +
            "where lower(a.name) like lower(concat('%', :searchTerm, '%')) ")
    List<Artist> search(@Param("searchTerm") String searchTerm);

    List<Artist> findByNameIgnoreCase(String name);

    Artist findByName(String name);
}
