package de.thpeetz.kontor.tysc.repository;

import de.thpeetz.kontor.tysc.data.FieldPosition;
import de.thpeetz.kontor.tysc.data.Player;
import de.thpeetz.kontor.tysc.data.Rooster;
import de.thpeetz.kontor.tysc.data.Team;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

public interface RoosterRepository extends JpaRepository<Rooster, String>{

    @Query("SELECT r FROM Rooster r WHERE r.player = ?1 AND r.team = ?2 AND r.position = ?3 AND r.year = ?4")
    Rooster findByReferences(Player player, Team team, FieldPosition position, int year);
}

