package de.avatic.taric.repository;

import de.avatic.taric.model.Import;
import org.springframework.data.jdbc.core.mapping.AggregateReference;
import org.springframework.data.jdbc.repository.query.Query;
import org.springframework.data.repository.CrudRepository;

import de.avatic.taric.model.AppliedMeasure;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface AppliedMeasureRepository extends CrudRepository<AppliedMeasure, Integer> {

    @Query("SELECT * FROM applied_measure WHERE import_id = :importId")
    List<AppliedMeasure> findByImport(@Param("importId") AggregateReference<Import, Integer> importRef);

}
