Class SlotDAO

  • All Implemented Interfaces:
    ISlotDAO

    public final class SlotDAO
    extends java.lang.Object
    implements ISlotDAO
    This class provides Data Access methods for Slot objects
    Author:
    Laurent Payen
    • Constructor Summary

      Constructors 
      Constructor Description
      SlotDAO()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void delete​(int nIdSlot, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Delete a appointment from the table
      void deleteByIdForm​(int nIdForm, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Delete a appointment from the table
      java.util.List<Slot> findByIdAppointment​(int nIdAppointment, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Returns all the slots of a form
      java.util.List<Slot> findByIdForm​(int nIdForm, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Returns all the slots of a form
      java.util.List<Slot> findByIdFormAndDateRange​(int nIdForm, java.time.LocalDateTime startingDateTime, java.time.LocalDateTime endingDateTime, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Returns all the slot for the date range
      java.util.List<Slot> findIsSpecificByIdForm​(int nIdForm, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Returns all the specific slot for the form
      java.util.List<Slot> findOpenSlotsByIdForm​(int nIdForm, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Returns all the open slots
      java.util.List<Slot> findOpenSlotsByIdFormAndDateRange​(int nIdForm, java.time.LocalDateTime startingDateTime, java.time.LocalDateTime endingDateTime, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Returns all the open slots for the given date range
      java.util.List<Slot> findSlotWithAppointmentByDateRange​(int nIdForm, java.time.LocalDateTime startingDateTime, java.time.LocalDateTime endingDateTime, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Returns all the slot containing an appointment for the date range
      Slot findSlotWithMaxDate​(int nIdForm, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Return the slot with the max date
      java.util.List<java.time.LocalDate> findSpecificSlotDates​(int nIdForm, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Return the specific slot dates from the form
      void insert​(Slot slot, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Insert a new record in the table
      void resetPotentialRemainingPlaces​(fr.paris.lutece.portal.service.plugin.Plugin plugin)
      update the availabilities metrics
      Slot select​(int nIdSlot, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Load the data from the table
      void update​(Slot slot, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Update the record in the table
      void updatePotentialRemainingPlaces​(int nbPotentialRemainingPlaces, int nIdSlot, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      update Potential Remaining Places
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SlotDAO

        public SlotDAO()
    • Method Detail

      • insert

        public void insert​(Slot slot,
                           fr.paris.lutece.portal.service.plugin.Plugin plugin)
        Description copied from interface: ISlotDAO
        Insert a new record in the table
        Specified by:
        insert in interface ISlotDAO
        Parameters:
        slot - instance of the Slot object to insert
        plugin - the plugin
      • update

        public void update​(Slot slot,
                           fr.paris.lutece.portal.service.plugin.Plugin plugin)
        Description copied from interface: ISlotDAO
        Update the record in the table
        Specified by:
        update in interface ISlotDAO
        Parameters:
        slot - the reference of the Slot
        plugin - the plugin
      • delete

        public void delete​(int nIdSlot,
                           fr.paris.lutece.portal.service.plugin.Plugin plugin)
        Description copied from interface: ISlotDAO
        Delete a appointment from the table
        Specified by:
        delete in interface ISlotDAO
        Parameters:
        nIdSlot - identifier of the Slot to delete
        plugin - the plugin
      • deleteByIdForm

        public void deleteByIdForm​(int nIdForm,
                                   fr.paris.lutece.portal.service.plugin.Plugin plugin)
        Description copied from interface: ISlotDAO
        Delete a appointment from the table
        Specified by:
        deleteByIdForm in interface ISlotDAO
        Parameters:
        nIdForm - identifier of the form
        plugin - the plugin
      • select

        public Slot select​(int nIdSlot,
                           fr.paris.lutece.portal.service.plugin.Plugin plugin)
        Description copied from interface: ISlotDAO
        Load the data from the table
        Specified by:
        select in interface ISlotDAO
        Parameters:
        nIdSlot - the identifier of the Slot
        plugin - the plugin
        Returns:
        the instance of the Slot
      • findByIdFormAndDateRange

        public java.util.List<Slot> findByIdFormAndDateRange​(int nIdForm,
                                                             java.time.LocalDateTime startingDateTime,
                                                             java.time.LocalDateTime endingDateTime,
                                                             fr.paris.lutece.portal.service.plugin.Plugin plugin)
        Description copied from interface: ISlotDAO
        Returns all the slot for the date range
        Specified by:
        findByIdFormAndDateRange in interface ISlotDAO
        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
      • findSlotWithAppointmentByDateRange

        public java.util.List<Slot> findSlotWithAppointmentByDateRange​(int nIdForm,
                                                                       java.time.LocalDateTime startingDateTime,
                                                                       java.time.LocalDateTime endingDateTime,
                                                                       fr.paris.lutece.portal.service.plugin.Plugin plugin)
        Description copied from interface: ISlotDAO
        Returns all the slot containing an appointment for the date range
        Specified by:
        findSlotWithAppointmentByDateRange in interface ISlotDAO
        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 java.util.List<Slot> findIsSpecificByIdForm​(int nIdForm,
                                                           fr.paris.lutece.portal.service.plugin.Plugin plugin)
        Description copied from interface: ISlotDAO
        Returns all the specific slot for the form
        Specified by:
        findIsSpecificByIdForm in interface ISlotDAO
        Parameters:
        nIdForm - the Form Id
        plugin - the plugin
        Returns:
        a list of specific slots
      • findByIdForm

        public java.util.List<Slot> findByIdForm​(int nIdForm,
                                                 fr.paris.lutece.portal.service.plugin.Plugin plugin)
        Description copied from interface: ISlotDAO
        Returns all the slots of a form
        Specified by:
        findByIdForm in interface ISlotDAO
        Parameters:
        nIdForm - the form id
        plugin - the plugin
        Returns:
        a list of all the slots of the form
      • findOpenSlotsByIdFormAndDateRange

        public java.util.List<Slot> findOpenSlotsByIdFormAndDateRange​(int nIdForm,
                                                                      java.time.LocalDateTime startingDateTime,
                                                                      java.time.LocalDateTime endingDateTime,
                                                                      fr.paris.lutece.portal.service.plugin.Plugin plugin)
        Description copied from interface: ISlotDAO
        Returns all the open slots for the given date range
        Specified by:
        findOpenSlotsByIdFormAndDateRange in interface ISlotDAO
        Parameters:
        nIdForm - the Form Id
        startingDateTime - the starting date
        endingDateTime - the ending date
        plugin - the plugin
        Returns:
        a list of open slots whose dates are included in the given period
      • findOpenSlotsByIdForm

        public java.util.List<Slot> findOpenSlotsByIdForm​(int nIdForm,
                                                          fr.paris.lutece.portal.service.plugin.Plugin plugin)
        Description copied from interface: ISlotDAO
        Returns all the open slots
        Specified by:
        findOpenSlotsByIdForm in interface ISlotDAO
        Parameters:
        nIdForm - the Form Id
        plugin - the plugin
        Returns:
        a list of open slots
      • findByIdAppointment

        public java.util.List<Slot> findByIdAppointment​(int nIdAppointment,
                                                        fr.paris.lutece.portal.service.plugin.Plugin plugin)
        Description copied from interface: ISlotDAO
        Returns all the slots of a form
        Specified by:
        findByIdAppointment in interface ISlotDAO
        Parameters:
        nIdAppointment - the appointment id
        plugin - the plugin
        Returns:
        a list of all the slots of the form
      • findSlotWithMaxDate

        public Slot findSlotWithMaxDate​(int nIdForm,
                                        fr.paris.lutece.portal.service.plugin.Plugin plugin)
        Description copied from interface: ISlotDAO
        Return the slot with the max date
        Specified by:
        findSlotWithMaxDate in interface ISlotDAO
        Parameters:
        nIdForm - the form id
        plugin - the plugin
        Returns:
        the slot
      • updatePotentialRemainingPlaces

        public void updatePotentialRemainingPlaces​(int nbPotentialRemainingPlaces,
                                                   int nIdSlot,
                                                   fr.paris.lutece.portal.service.plugin.Plugin plugin)
        Description copied from interface: ISlotDAO
        update Potential Remaining Places
        Specified by:
        updatePotentialRemainingPlaces in interface ISlotDAO
      • resetPotentialRemainingPlaces

        public void resetPotentialRemainingPlaces​(fr.paris.lutece.portal.service.plugin.Plugin plugin)
        Description copied from interface: ISlotDAO
        update the availabilities metrics
        Specified by:
        resetPotentialRemainingPlaces in interface ISlotDAO
        Parameters:
        plugin - the plugin
      • findSpecificSlotDates

        public java.util.List<java.time.LocalDate> findSpecificSlotDates​(int nIdForm,
                                                                         fr.paris.lutece.portal.service.plugin.Plugin plugin)
        Description copied from interface: ISlotDAO
        Return the specific slot dates from the form
        Specified by:
        findSpecificSlotDates in interface ISlotDAO
        Parameters:
        nIdForm - the id Form
        plugin - the plugin
        Returns:
        list of date