Class Event
java.lang.Object
com.endurancetrio.data.common.model.entity.AuditableEntity
com.endurancetrio.data.common.model.entity.BaseEntity<Long>
com.endurancetrio.data.event.model.entity.Event
- All Implemented Interfaces:
Serializable
The
Event entity represents an endurance sport Event that can have
one or more endurance races.
The Event's fields are defined as follows:
-
id: the unique identifier of theEventthat is automatically generated and is the primary key. -
eventReference: the uniqueEventreference number that is exactly 14 characters long and has the format "YYYYMMDDXXXNNN". In this format, "YYYY" corresponds to the year of theEventstartDate, "MM" corresponds to the month of theEventstartDate, "DD" corresponds to the day of theEventstartDate, "XXX" corresponds to theEvent's scope code (written in upper case), and "NNN" corresponds to theEvent's order number. TheEvent's order number is the number corresponding to the chronological order ofEvent's with the samestartDateand the same scope. That is, the firstEventwith the samestartDateand scope has an order number (""NNN"") of 001, the secondEventwith that samestartDateand scope has an order number of 002, and so on. title: the title of theEvent.startDate: the start date of theEvent.-
endDate: the end date of theEvent. As anEventcan be held on a single day or span several days, theendDatemust be equals or after thestartDate. -
district: the district of theevent's main location. county: the county of theevent's main location.city: the city of theevent's main location.-
organizers: theOrganizerof theEvent. Aneventcan have one or multipleorganizers. -
eventFiles: the list ofevent filesof theEvent. Aneventcan have zero or multipleevent files. -
courses: thecoursesof theEvent. AnEventcan have one or multiplecourses.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanEquality is based on the entity's identifier.getCity()getTitle()inthashCode()voidremoveCourse(Course course) voidvoidvoidsetCourses(Set<Course> courses) voidsetDistrict(String district) voidsetEndDate(LocalDate endDate) voidsetEventFiles(Set<EventFile> eventFiles) voidsetEventReference(String eventReference) voidsetOrganizers(Set<Organizer> organizers) voidsetStartDate(LocalDate startDate) voidtoString()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
-
Event
public Event()Default constructor for theEvententity.
-
-
Method Details
-
addCourse
- Parameters:
course- theCourseto be added
-
removeCourse
- Parameters:
course- theCourseto be removed
-
getEventReference
-
setEventReference
-
getTitle
-
setTitle
-
getStartDate
-
setStartDate
-
getEndDate
-
setEndDate
-
getDistrict
-
setDistrict
-
getCounty
-
setCounty
-
getCity
-
setCity
-
getOrganizers
-
setOrganizers
-
getEventFiles
-
setEventFiles
-
getCourses
-
setCourses
-
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
-