package es.uv.saic.domain;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

@Repository
public interface GraficaRepository  extends JpaRepository<Grafica, GraficaPK> {

	@Query(value="SELECT * FROM grafiques WHERE ambit LIKE ?1", nativeQuery=true)
	List<Grafica> findLikeAmbit(String ambit);
	
	@Query(value="SELECT * FROM grafiques WHERE ambit LIKE ?1 AND UPPER(estudi) = UPPER(?2)", nativeQuery=true)
	List<Grafica> findLikeAmbitAndEstudi(String ambit, String estudi);
	
}
