package org.springboot.sample.dao;
import java.util.List;
import javax.transaction.Transactional;
import org.springboot.sample.entity.Score;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;
public interface IScoreDao extends CrudRepository<Score, Integer> {
@Transactional
@Modifying
@Query("update Score t set t.score = :score where t.id = :id")
int updateScoreById(@Param("score") float score, @Param("id") int id);
@Query("select t from Score t ")
List<Score> getList();
}