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


    Worktype findByName(String name);

    List<Worktype> findByNameIgnoreCase(String name);
}
