Skip to content
Snippets Groups Projects
Commit e9ba03dc authored by Diana Gulčíková's avatar Diana Gulčíková
Browse files

wip

parent f1cc08be
No related branches found
No related tags found
2 merge requests!60Docker,!3317 statistics endpoint
package cz.muni.pa165.race.data.repository;
import cz.muni.pa165.common_library.racecomponents.Location;
import cz.muni.pa165.common_library.racecomponents.Race;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
/**
* Race repository.
*/
@Repository
// TODO queries na assignovanie driverov
public interface RaceRepository extends JpaRepository<Race, Long> {
@Query("SELECT r FROM Race r" +
" JOIN r.raceInfo ri " +
" JOIN r.driver1 do " +
" JOIN r.driver2 dt " +
"WHERE ri.location = :location AND (do.id = :driverId OR dt.id = :driverId)")
List<Race> findAllRacesOfDriverInLocation(@Param("location") Location raceLocation,
@Param("driverId") long driverId);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment