package de.thpeetz.kontor.tysc.repository;

import java.util.List;

import de.thpeetz.kontor.tysc.data.Sport;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

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

        Sport findByName(String name);

        List<Sport> findByNameIgnoreCase(String name);
}
