Class ServicesDAO
java.lang.Object
br.com.pethub.dao.ServicesDAO
This class is responsible for managing the data access for the Services in the application.
It provides methods to add, edit, delete services, list services, search services by name, add, edit, delete schedules, check schedule conflict, delete schedule by pet id, and delete service schedules by service id.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addSchedule
(Schedule obj) This method is used to add a schedule to the database.void
addServices
(Services obj) This method is used to add a service to the database.boolean
This method is used to check if a schedule conflicts with an existing one.void
deleteSchedule
(Schedule obj) This method is used to delete a schedule from the database.void
deleteScheduleByPetId
(int petId) This method is used to delete a schedule by pet id.void
deleteServices
(Services obj) This method is used to delete a service from the database.void
deleteServiceSchedulesByServiceId
(int serviceId) This method is used to delete service schedules by service id.void
editSchedule
(Schedule obj) This method is used to edit a schedule in the database.void
editServices
(Services obj) This method is used to edit a service in the database.getServicesByName
(String name) This method is used to retrieve a list of services for a specific name from the database.This method is used to retrieve a list of all schedules from the database.listSchedules
(LocalDate date_start, LocalDate date_end) This method is used to retrieve a list of schedules within a date range from the database.This method is used to retrieve a list of schedules for today from the database.This method is used to retrieve a list of all services from the database.searchServicesByName
(String name) This method is used to search for services by name.
-
Constructor Details
-
ServicesDAO
public ServicesDAO()The constructor method of the ServicesDAO class.
-
-
Method Details
-
addServices
This method is used to add a service to the database.- Parameters:
obj
- The service to be added.
-
editServices
This method is used to edit a service in the database.- Parameters:
obj
- The service with the updated details.
-
deleteServices
This method is used to delete a service from the database.- Parameters:
obj
- The service to be deleted.
-
listServices
-
searchServicesByName
-
listSchedules
-
listSchedules
This method is used to retrieve a list of schedules within a date range from the database.- Parameters:
date_start
- The start date of the range.date_end
- The end date of the range.- Returns:
- A list of schedules within the date range.
-
listSchedulesForToday
-
getServicesByName
-
addSchedule
This method is used to add a schedule to the database.- Parameters:
obj
- The schedule to be added.
-
editSchedule
This method is used to edit a schedule in the database.- Parameters:
obj
- The schedule with the updated details.
-
deleteSchedule
This method is used to delete a schedule from the database.- Parameters:
obj
- The schedule to be deleted.
-
checkScheduleConflict
This method is used to check if a schedule conflicts with an existing one.- Parameters:
obj
- The schedule to check for conflicts.- Returns:
- true if there is a conflict, false otherwise.
-
deleteScheduleByPetId
public void deleteScheduleByPetId(int petId) This method is used to delete a schedule by pet id.- Parameters:
petId
- The id of the pet to delete the schedule for.
-
deleteServiceSchedulesByServiceId
public void deleteServiceSchedulesByServiceId(int serviceId) This method is used to delete service schedules by service id.- Parameters:
serviceId
- The id of the service to delete the schedules for.
-