Class RaceServiceMain
java.lang.Object
com.endurancetrio.business.event.service.RaceServiceMain
- All Implemented Interfaces:
RaceService
-
Constructor Summary
ConstructorsConstructorDescriptionRaceServiceMain(IndividualResultRepository individualResultRepository, IndividualResultMapper individualResultMapper, RaceRepository raceRepository, RaceMapper raceMapper) -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.data.domain.Page<RaceDTO> getNonDerivedRacesWithMostRecentAddedResults(org.springframework.data.domain.Pageable pageable) Returns aPageof the most recent non-derivedracesthat have at least one result recorded in the database.getRaceResults(RaceDTO race)
-
Constructor Details
-
RaceServiceMain
@Autowired public RaceServiceMain(IndividualResultRepository individualResultRepository, IndividualResultMapper individualResultMapper, RaceRepository raceRepository, RaceMapper raceMapper)
-
-
Method Details
-
getNonDerivedRacesWithMostRecentAddedResults
@Cacheable(value="nonDerivedRecentRacesWithMostRecentAddedResults", key="#pageable.pageNumber + \'-\' + #pageable.pageSize") @Transactional(readOnly=true) public org.springframework.data.domain.Page<RaceDTO> getNonDerivedRacesWithMostRecentAddedResults(org.springframework.data.domain.Pageable pageable) Description copied from interface:RaceServiceReturns aPageof the most recent non-derivedracesthat have at least one result recorded in the database.Derived race types (
INDIVIDUAL_DERIVED,TEAM_RELAY_DERIVED,MIXED_RELAY_DERIVED) are excluded. Results are ordered by the most recent result creation date descending.- Specified by:
getNonDerivedRacesWithMostRecentAddedResultsin interfaceRaceService- Parameters:
pageable- the pagination information- Returns:
- a
Pageofraces
-
getRaceResults
@Cacheable(value="raceResults", key="#race.id()") @Transactional(readOnly=true) public RaceResultsDTO getRaceResults(RaceDTO race) Description copied from interface:RaceServiceReturns aRaceResultsDTOcontaining the results of the givenrace, grouped byAgeGroup. The results include individual, team, or relay entries depending on the race's type group, each enriched with computed time gaps relative to the overall winner.- Specified by:
getRaceResultsin interfaceRaceService- Parameters:
race- the race whose results are to be retrieved- Returns:
- a
RaceResultsDTOwith the race results
-