Class HolidayEntity

java.lang.Object
com.app.persistence.entity.BaseEntity
com.app.persistence.entity.HolidayEntity

@Entity public class HolidayEntity extends BaseEntity
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.
  • Constructor Details

    • HolidayEntity

      public HolidayEntity()
  • Method Details

    • withUserEntity

      public HolidayEntity withUserEntity(UserEntity userEntity)
      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

      public HolidayEntity withStatus(Status status)
      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

      public HolidayDto toHolidayDto()
      Converts this entity to its corresponding DTO.
      Returns:
      a HolidayDto representing this holiday