package org.hso.ecommerce.repos.supplier;

import java.util.List;

import org.hso.ecommerce.entities.supplier.Supplier;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface SupplierRepository extends JpaRepository<Supplier, Long> {
	
	@Query("SELECT a FROM Supplier a")
	List<Supplier> findAll();
	
	@Query("SELECT a FROM Supplier a WHERE a.id = :supplierId")
	Supplier findSupplierById(@Param("supplierId") long supplierId);
}