Class SlotHome


  • public final class SlotHome
    extends Object
    This class provides instances management methods for Slot objects
    Author:
    Laurent Payen
    • Method Detail

      • create

        public static Slot create​(Slot slot)
        Create an instance of the Slot class
        Parameters:
        slot - The instance of the Slot which contains the informations to store
        Returns:
        The instance of the Slot which has been created with its primary key.
      • update

        public static Slot update​(Slot slot)
        Update of the Slot which is specified in parameter
        Parameters:
        slot - The instance of the Slot which contains the data to store
        Returns:
        The instance of the Slot which has been updated
      • delete

        public static void delete​(int nKey)
        Delete the Slot whose identifier is specified in parameter
        Parameters:
        nKey - The Slot Id
      • deleteByIdForm

        public static void deleteByIdForm​(int nIdForm)
        Delete a appointment from the table
        Parameters:
        nIdForm - identifier of the form
      • findByPrimaryKey

        public static Slot findByPrimaryKey​(int nKey)
        Returns an instance of the Slot whose identifier is specified in parameter
        Parameters:
        nKey - The Slot primary key
        Returns:
        an instance of the Slot
      • findByIdFormAndDateRange

        public static List<Slot> findByIdFormAndDateRange​(int nIdForm,
                                                          LocalDateTime startingDateTime,
                                                          LocalDateTime endingDateTime)
        Returns a list of slots for a date range
        Parameters:
        nIdForm - the Form Id
        startingDateTime - the starting Date
        endingDateTime - the ending Date
        Returns:
        a list of slots whose dates are included in the given period
      • findSlotWithAppointmentByDateRange

        public static List<Slot> findSlotWithAppointmentByDateRange​(int nIdForm,
                                                                    LocalDateTime startingDateTime,
                                                                    LocalDateTime endingDateTime)
        Returns all the slot containing an appointment for the date range
        Parameters:
        nIdForm - the Form Id
        startingDateTime - the starting date
        endingDateTime - the ending date
        plugin - the plugin
        Returns:
        a list of slots whose dates are included in the given period and is containing an appointment
      • findIsSpecificByIdForm

        public static List<Slot> findIsSpecificByIdForm​(int nIdForm)
        Returns a list of specific slots for a form
        Parameters:
        nIdForm - the Form Id
        Returns:
        a list of slots found
      • findByIdForm

        public static List<Slot> findByIdForm​(int nIdForm)
        Returns a list of slots of a form
        Parameters:
        nIdForm - the form id
        Returns:
        a list of all the slots of the form
      • findOpenSlotsByIdFormAndDateRange

        public static List<Slot> findOpenSlotsByIdFormAndDateRange​(int nIdForm,
                                                                   LocalDateTime startingDateTime,
                                                                   LocalDateTime endingDateTime)
        Returns a list of open slots for a date range
        Parameters:
        nIdForm - the Form Id
        startingDateTime - the starting Date
        endingDateTime - the ending Date
        Returns:
        a list of open slots whose dates are included in the given period
      • findOpenSlotsByIdForm

        public static List<Slot> findOpenSlotsByIdForm​(int nIdForm)
        Returns a list of open slots
        Parameters:
        nIdForm - the Form Id
        Returns:
        a list of open slots
      • findSlotWithTheMaxDate

        public static Slot findSlotWithTheMaxDate​(int nIdForm)
        Return the Slot that have the max date
        Parameters:
        nIdForm - the form id
        Returns:
        the slot
      • findByIdAppointment

        public static List<Slot> findByIdAppointment​(int nIdAppointment)
        Returns a list of slots of a form
        Parameters:
        nIdAppointment - the appointment id
        Returns:
        a list of all the slots of the form
      • updatePotentialRemainingPlaces

        public static void updatePotentialRemainingPlaces​(int nbPotentialRemainingPlaces,
                                                          int nIdSlot)
        Update Potential Remaining Places
        Parameters:
        nbPotentialRemainingPlaces -
        nIdSlot -
      • resetPotentialRemainingPlaces

        public static void resetPotentialRemainingPlaces()
        Reset Potential Remaining Places
        Parameters:
        nbPotentialRemainingPlaces -
        nIdSlot -
      • findSpecificSlotDates

        public static List<LocalDate> findSpecificSlotDates​(int nIdForm)
        Return the specific slot dates from the form
        Parameters:
        nIdForm - the id Form
        plugin - the plugin
        Returns:
        list of date