package de.thpeetz.kontor.tysc.repository;

import java.util.List;

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

public interface VendorRepository extends JpaRepository<Vendor, String> {

    @Query("select v from Vendor v where lower(v.name) like lower(concat('%', :searchTerm, '%')) ")
    List<Vendor> search(@Param("searchTerm") String searchTerm);

    Vendor findByName(String name);

    List<Vendor> findByNameIgnoreCase(String name);
}
