Class ReservationRuleHome


  • public final class ReservationRuleHome
    extends Object
    This class provides instances management methods for Reservation Rule objects
    Author:
    Laurent Payen
    • Method Detail

      • create

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

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

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

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

        public static List<ReservationRule> findByIdForm​(int nIdForm)
        Returns all the Reservation Rule of a form
        Parameters:
        nIdForm - the Form Id
        Returns:
        a list of ReservationRule of the form
      • findByIdFormAndDateOfApply

        public static ReservationRule findByIdFormAndDateOfApply​(int nIdForm,
                                                                 LocalDate dateOfApply)
        Returns the Reservation Rule with the given search parameters
        Parameters:
        nIdForm - the Form Id
        dateOfApply - the date of apply
        Returns:
        the ReservationRule
      • findReservationRuleByIdFormAndClosestToDateOfApply

        public static ReservationRule findReservationRuleByIdFormAndClosestToDateOfApply​(int nIdForm,
                                                                                         LocalDate dateOfApply)
        Find in database a reservation rule of a form closest to a date
        Parameters:
        nIdForm - the Form Id
        dateOfApply - the date of apply
        plugin - the plugin
        Returns:
        the reservation rule that matches