Class Race
java.lang.Object
com.endurancetrio.data.common.model.entity.AuditableEntity
com.endurancetrio.data.common.model.entity.BaseEntity<Long>
com.endurancetrio.data.event.model.entity.Race
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
TriathlonBasedRace
The
Race's fields are defined as follows:
-
id: the unique identifier of theRacethat is automatically generated and is the primary key. -
raceReference: is a race reference number that has exactly 18 characters and has the format "YYYYMMDDXXXNNN-YYY". In this format, "YYYMMDDXXXNNN" follows the same formation rules as theeventReferencewith the particularity that the segment referring to the date corresponds to the start date of theRace. "YYY" corresponds to theRaceorder number which follows the order of theRace'sstart time. TheraceReferenceis unique, there cannot be two differentraceswith the sameraceReference. -
courses: thecourseswhere theRaceis raced. raceType: thetypeof theRace-
parentRaces: the list ofRacethat theRacedepends on. For example, a collectiveRace(those in which the competitors are clubs and/or teams) has results that are calculated from the results of an individualRaceand therefore that individualRaceis its parentRace. -
title: the title of theRace. Together with thesubtitleit unequivocally identifies theRace. Thetitleof theRacemust preferably be the same as the championship it belongs to (e.g., Individual National Championship) or the distance of theRace(e.g., Duathlon Powerman Mafra Sprint and Duathlon Powerman Mafra Standard). -
subtitle: the subtitle of theRace. Together with thetitle, it unequivocally identifies theRace. If thegenderCategoryof theRaceis sufficient to unequivocally distinguish thegenderCategory, only thegenderCategoryis used as asubtitle(e.g., "Women"). genderCategorythe gender category of theRace.date: the date of theRace.time: the time scheduled for the starting gun of theRace.-
raceStatus: thestatusof theRace, always displayed in theRace's time zone. -
gunTime: the time of the starting gun of theRace, always displayed in theRace's time zone. -
airTemperature: the official air temperature for theRace(in Celsius). -
resultsFiles: theResultsFileof theRace.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddParentRace(Race parentRace) booleanEquality is based on the entity's identifier.getDate()getTime()getTitle()inthashCode()voidremoveCourse(Course course) voidremoveParentRace(Race parentRace) voidsetAirTemperature(Double airTemperature) voidsetCourses(Set<Course> courses) voidvoidsetGenderCategory(GenderCategory genderCategory) voidsetGunTime(LocalTime gunTime) voidsetParentRaces(Set<Race> parentRaces) voidsetRaceReference(String raceReference) voidsetRaceStatus(RaceStatus raceStatus) voidsetRaceType(RaceType raceType) voidsetResultsFiles(Set<ResultsFile> resultsFiles) voidsetSubtitle(String subtitle) voidvoidtoString()Methods inherited from class com.endurancetrio.data.common.model.entity.BaseEntity
getId, setIdMethods inherited from class com.endurancetrio.data.common.model.entity.AuditableEntity
getCreatedAt, getUpdatedAt, getVersion
-
Constructor Details
-
Race
public Race()Default constructor for theRaceentity.
-
-
Method Details
-
addCourse
Adds aCourseto thisRace'sracescollection. Ensures bidirectional consistency by also adding thisRaceto theCourse'sracescollection.- Parameters:
course- theCourseto add; ignored ifnullor already present
-
removeCourse
Removes aCoursefrom thisRace'scoursescollection. Ensures bidirectional consistency by also removing thisRacefrom theCourse'sracescollection.- Parameters:
course- theCourseto remove; ignored ifnullor not present
-
addParentRace
Adds a parentRaceto thisRace.This method establishes a parent-child relationship between the current
Raceand the providedRace. The parentRacemust already be persisted in the database before adding it as a parent.- Parameters:
parentRace- TheRaceto be added as a parent. It must be a non-null race.
-
removeParentRace
Removes a parentRacefrom thisRace.This method removes the association between the current
Raceand the specified parentRace. The provided parentRacemust be one of the already existingparentRacesof thisRace.- Parameters:
parentRace- TheRaceto be removed from the listparentRaces. It must already be associated as a parent.
-
getRaceReference
-
setRaceReference
-
getCourses
-
setCourses
-
getRaceType
-
setRaceType
-
getParentRaces
-
setParentRaces
-
getTitle
-
setTitle
-
getSubtitle
-
setSubtitle
-
getGenderCategory
-
setGenderCategory
-
getDate
-
setDate
-
getTime
-
setTime
-
getRaceStatus
-
setRaceStatus
-
getGunTime
-
setGunTime
-
getAirTemperature
-
setAirTemperature
-
getResultsFiles
-
setResultsFiles
-
equals
Description copied from class:BaseEntityEquality is based on the entity's identifier. Two entities are considered equal if they are of the same class and have the same non-null identifier.If the ID is null, we treat it as a transient (new) object. Transient objects are only equal if they are the exact same instance.
- Overrides:
equalsin classBaseEntity<Long>
-
hashCode
public int hashCode()- Overrides:
hashCodein classBaseEntity<Long>
-
toString
-