Class HolidayEntity
java.lang.Object
com.app.persistence.entity.BaseEntity
com.app.persistence.entity.HolidayEntity
Entity representing a holiday request or record.
Maps to the "holidays" table with a unique constraint on start and end dates.
Extends
BaseEntity
to inherit the identifier.-
Field Summary
Fields inherited from class com.app.persistence.entity.BaseEntity
id
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionConverts this entity to its corresponding DTO.withStatus
(Status status) Creates a new HolidayEntity with the given status, copying existing fields including id.withUserEntity
(UserEntity userEntity) Creates a new HolidayEntity with the given user entity, copying existing fields.Methods inherited from class com.app.persistence.entity.BaseEntity
equals, hashCode
-
Constructor Details
-
HolidayEntity
public HolidayEntity()
-
-
Method Details
-
withUserEntity
Creates a new HolidayEntity with the given user entity, copying existing fields.- Parameters:
userEntity
- the user to associate with this holiday- Returns:
- a new HolidayEntity instance with updated user
-
withStatus
Creates a new HolidayEntity with the given status, copying existing fields including id.- Parameters:
status
- the new status to set- Returns:
- a new HolidayEntity instance with updated status
-
toHolidayDto
Converts this entity to its corresponding DTO.- Returns:
- a
HolidayDto
representing this holiday
-