java.lang.Object
fr.paris.lutece.plugins.appointment.modules.resource.business.AppointmentResourceDAO
All Implemented Interfaces:
IAppointmentResourceDAO

public class AppointmentResourceDAO extends Object implements IAppointmentResourceDAO
Appointment resource DAO
  • Field Summary

    Fields inherited from interface fr.paris.lutece.plugins.appointment.modules.resource.business.IAppointmentResourceDAO

    BEAN_NAME
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    delete(int nIdAppointment, int nIdAppointmentFormResourceType, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Delete an appointment resource
    void
    deleteByIdAppointment(int nIdAppointment, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Delete appointment resource associated with a given appointment
    void
    deleteByIdAppointmentFormResourceType(int nIdAppointmentFormResourceType, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Delete appointment resource associated with a given appointment form resource type
    findByIdAppointment(int nIdAppointment, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Find appointment resource associated with a given appointment
    findByPrimaryKey(int nIdAppointment, int nIdAppointmentFormResourceType, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Find an appointment resource from its primary key
    findIdAppointmentsByResourceAndDate(String strIdResource, String strResourceType, Date dateMin, Date dateMax, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Get the list of id of appointments a resource is associated to between two given dates
    void
    insert(AppointmentResource resource, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Insert a new appointment resource
    boolean
    isResourceAvailable(String strIdResource, String strResourceTypeName, Timestamp nStartingTime, Timestamp nEndingTime, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Check if a resource is available for a given period, or if it has already been associated with an appointment
    void
    update(AppointmentResource resource, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Update an appointment resource

    Methods inherited from class java.lang.Object

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

    • AppointmentResourceDAO

      public AppointmentResourceDAO()
  • Method Details

    • insert

      public void insert(AppointmentResource resource, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Insert a new appointment resource
      Specified by:
      insert in interface IAppointmentResourceDAO
      Parameters:
      resource - The appointment resource to insert
      plugin - The plugin
    • findByPrimaryKey

      public AppointmentResource findByPrimaryKey(int nIdAppointment, int nIdAppointmentFormResourceType, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Find an appointment resource from its primary key
      Specified by:
      findByPrimaryKey in interface IAppointmentResourceDAO
      Parameters:
      nIdAppointment - The id of the appointment
      nIdAppointmentFormResourceType - the id of the appointment form resource type
      plugin - The plugin
      Returns:
      The appointment resource, or null if no appointment resource has the given id
    • findByIdAppointment

      public List<AppointmentResource> findByIdAppointment(int nIdAppointment, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Find appointment resource associated with a given appointment
      Specified by:
      findByIdAppointment in interface IAppointmentResourceDAO
      Parameters:
      nIdAppointment - the id of the appointment
      plugin - The plugin
      Returns:
      The list of appointment resource associated with the given appointment, or an empty list if no appointment resource is associated with the appointment
    • update

      public void update(AppointmentResource resource, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Update an appointment resource
      Specified by:
      update in interface IAppointmentResourceDAO
      Parameters:
      resource - The appointment resource to update
      plugin - The plugin
    • delete

      public void delete(int nIdAppointment, int nIdAppointmentFormResourceType, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Delete an appointment resource
      Specified by:
      delete in interface IAppointmentResourceDAO
      Parameters:
      nIdAppointment - The id of the appointment of the appointment resource
      nIdAppointmentFormResourceType - The id of the appointment form resource type of the appointment resource
      plugin - The plugin
    • deleteByIdAppointment

      public void deleteByIdAppointment(int nIdAppointment, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Delete appointment resource associated with a given appointment
      Specified by:
      deleteByIdAppointment in interface IAppointmentResourceDAO
      Parameters:
      nIdAppointment - The id of the appointment
      plugin - The plugin
    • deleteByIdAppointmentFormResourceType

      public void deleteByIdAppointmentFormResourceType(int nIdAppointmentFormResourceType, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Delete appointment resource associated with a given appointment form resource type
      Specified by:
      deleteByIdAppointmentFormResourceType in interface IAppointmentResourceDAO
      Parameters:
      nIdAppointmentFormResourceType - The id of the appointment form resource type
      plugin - The plugin
    • isResourceAvailable

      public boolean isResourceAvailable(String strIdResource, String strResourceTypeName, Timestamp nStartingTime, Timestamp nEndingTime, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Check if a resource is available for a given period, or if it has already been associated with an appointment
      Specified by:
      isResourceAvailable in interface IAppointmentResourceDAO
      Parameters:
      strIdResource - The id of the resource
      strResourceTypeName - The type of the resource
      nStartingTime - The beginning time
      nEndingTime - the ending time
      plugin - the plugin
      Returns:
      True if the resource is available, false otherwise
    • findIdAppointmentsByResourceAndDate

      public List<Integer> findIdAppointmentsByResourceAndDate(String strIdResource, String strResourceType, Date dateMin, Date dateMax, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Get the list of id of appointments a resource is associated to between two given dates
      Specified by:
      findIdAppointmentsByResourceAndDate in interface IAppointmentResourceDAO
      Parameters:
      strIdResource - The id of the resource
      strResourceType - The resource type
      dateMin - The minimum date
      dateMax - the maximum date
      plugin - The plugin
      Returns:
      The list of ids of appointments