Class SlotHome
- java.lang.Object
-
- fr.paris.lutece.plugins.appointment.business.slot.SlotHome
-
public final class SlotHome extends Object
This class provides instances management methods for Slot objects- Author:
- Laurent Payen
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Slotcreate(Slot slot)Create an instance of the Slot classstatic voiddelete(int nKey)Delete the Slot whose identifier is specified in parameterstatic voiddeleteByIdForm(int nIdForm)Delete a appointment from the tablestatic List<Slot>findByIdAppointment(int nIdAppointment)Returns a list of slots of a formstatic List<Slot>findByIdForm(int nIdForm)Returns a list of slots of a formstatic List<Slot>findByIdFormAndDateRange(int nIdForm, LocalDateTime startingDateTime, LocalDateTime endingDateTime)Returns a list of slots for a date rangestatic SlotfindByPrimaryKey(int nKey)Returns an instance of the Slot whose identifier is specified in parameterstatic List<Slot>findIsSpecificByIdForm(int nIdForm)Returns a list of specific slots for a formstatic List<Slot>findOpenSlotsByIdForm(int nIdForm)Returns a list of open slotsstatic List<Slot>findOpenSlotsByIdFormAndDateRange(int nIdForm, LocalDateTime startingDateTime, LocalDateTime endingDateTime)Returns a list of open slots for a date rangestatic List<Slot>findSlotWithAppointmentByDateRange(int nIdForm, LocalDateTime startingDateTime, LocalDateTime endingDateTime)Returns all the slot containing an appointment for the date rangestatic SlotfindSlotWithTheMaxDate(int nIdForm)Return the Slot that have the max datestatic List<LocalDate>findSpecificSlotDates(int nIdForm)Return the specific slot dates from the formstatic voidresetPotentialRemainingPlaces()Reset Potential Remaining Placesstatic Slotupdate(Slot slot)Update of the Slot which is specified in parameterstatic voidupdatePotentialRemainingPlaces(int nbPotentialRemainingPlaces, int nIdSlot)Update Potential Remaining Places
-
-
-
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 IdstartingDateTime- the starting DateendingDateTime- 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 IdstartingDateTime- the starting dateendingDateTime- the ending dateplugin- 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 IdstartingDateTime- the starting DateendingDateTime- 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-
-
-