package com.example.Vezba.repository;

import com.example.Vezba.model.Ocena;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

@Repository
public interface OcenaRepository extends JpaRepository<Ocena, Integer> {

    @Transactional
    @Modifying
    @Query("UPDATE Ocena o SET o.ocena=?1 WHERE  o.idOcenjivaca=?2 AND o.idPoslodavca=?3")
    int updateOcena(Integer ocena,Integer idOcenjivaca,Integer idPoslodavca);
}
