Class AppointmentResourceDAO
java.lang.Object
fr.paris.lutece.plugins.appointment.modules.resource.business.AppointmentResourceDAO
- All Implemented Interfaces:
IAppointmentResourceDAO
Appointment resource DAO
-
Field Summary
Fields inherited from interface fr.paris.lutece.plugins.appointment.modules.resource.business.IAppointmentResourceDAO
BEAN_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddelete(int nIdAppointment, int nIdAppointmentFormResourceType, fr.paris.lutece.portal.service.plugin.Plugin plugin) Delete an appointment resourcevoiddeleteByIdAppointment(int nIdAppointment, fr.paris.lutece.portal.service.plugin.Plugin plugin) Delete appointment resource associated with a given appointmentvoiddeleteByIdAppointmentFormResourceType(int nIdAppointmentFormResourceType, fr.paris.lutece.portal.service.plugin.Plugin plugin) Delete appointment resource associated with a given appointment form resource typefindByIdAppointment(int nIdAppointment, fr.paris.lutece.portal.service.plugin.Plugin plugin) Find appointment resource associated with a given appointmentfindByPrimaryKey(int nIdAppointment, int nIdAppointmentFormResourceType, fr.paris.lutece.portal.service.plugin.Plugin plugin) Find an appointment resource from its primary keyfindIdAppointmentsByResourceAndDate(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 datesvoidinsert(AppointmentResource resource, fr.paris.lutece.portal.service.plugin.Plugin plugin) Insert a new appointment resourcebooleanisResourceAvailable(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 appointmentvoidupdate(AppointmentResource resource, fr.paris.lutece.portal.service.plugin.Plugin plugin) Update an appointment resource
-
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:
insertin interfaceIAppointmentResourceDAO- Parameters:
resource- The appointment resource to insertplugin- 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:
findByPrimaryKeyin interfaceIAppointmentResourceDAO- Parameters:
nIdAppointment- The id of the appointmentnIdAppointmentFormResourceType- the id of the appointment form resource typeplugin- 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:
findByIdAppointmentin interfaceIAppointmentResourceDAO- Parameters:
nIdAppointment- the id of the appointmentplugin- 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:
updatein interfaceIAppointmentResourceDAO- Parameters:
resource- The appointment resource to updateplugin- The plugin
-
delete
public void delete(int nIdAppointment, int nIdAppointmentFormResourceType, fr.paris.lutece.portal.service.plugin.Plugin plugin) Delete an appointment resource- Specified by:
deletein interfaceIAppointmentResourceDAO- Parameters:
nIdAppointment- The id of the appointment of the appointment resourcenIdAppointmentFormResourceType- The id of the appointment form resource type of the appointment resourceplugin- 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:
deleteByIdAppointmentin interfaceIAppointmentResourceDAO- Parameters:
nIdAppointment- The id of the appointmentplugin- 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:
deleteByIdAppointmentFormResourceTypein interfaceIAppointmentResourceDAO- Parameters:
nIdAppointmentFormResourceType- The id of the appointment form resource typeplugin- 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:
isResourceAvailablein interfaceIAppointmentResourceDAO- Parameters:
strIdResource- The id of the resourcestrResourceTypeName- The type of the resourcenStartingTime- The beginning timenEndingTime- the ending timeplugin- 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:
findIdAppointmentsByResourceAndDatein interfaceIAppointmentResourceDAO- Parameters:
strIdResource- The id of the resourcestrResourceType- The resource typedateMin- The minimum datedateMax- the maximum dateplugin- The plugin- Returns:
- The list of ids of appointments
-