Class VaccineDAO
java.lang.Object
br.com.pethub.dao.VaccineDAO
This class is responsible for managing the data access for the Vaccines in the application.
It provides methods to add, edit, delete vaccines, list vaccines, search vaccines by name, delete vaccines by customer id, and delete vaccines by pet id.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addVaccine
(Vaccine obj) This method is used to add a vaccine to the database.void
deleteVaccine
(Vaccine obj) This method is used to delete a vaccine from the database.void
deleteVaccinesByCustomerId
(int customerId) This method is used to delete all vaccines associated with a specific customer id.void
deleteVaccinesByPetId
(int petId) This method is used to delete all vaccines associated with a specific pet id.void
editVaccine
(Vaccine obj) This method is used to edit a vaccine in the database.This method is used to retrieve a list of all vaccines from the database.searchVaccines
(String name) This method is used to search for vaccines by name.
-
Constructor Details
-
VaccineDAO
public VaccineDAO()The constructor method of the VaccineDAO class.
-
-
Method Details
-
addVaccine
This method is used to add a vaccine to the database.- Parameters:
obj
- The vaccine to be added.
-
editVaccine
This method is used to edit a vaccine in the database.- Parameters:
obj
- The vaccine with the updated details.
-
deleteVaccine
This method is used to delete a vaccine from the database.- Parameters:
obj
- The vaccine to be deleted.
-
listVaccines
-
searchVaccines
-
deleteVaccinesByCustomerId
public void deleteVaccinesByCustomerId(int customerId) This method is used to delete all vaccines associated with a specific customer id.- Parameters:
customerId
- The id of the customer.
-
deleteVaccinesByPetId
public void deleteVaccinesByPetId(int petId) This method is used to delete all vaccines associated with a specific pet id.- Parameters:
petId
- The id of the pet.
-