Class VaccineDAO

java.lang.Object
br.com.pethub.dao.VaccineDAO

public class VaccineDAO extends Object
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 Details

    • VaccineDAO

      public VaccineDAO()
      The constructor method of the VaccineDAO class.
  • Method Details

    • addVaccine

      public void addVaccine(Vaccine obj)
      This method is used to add a vaccine to the database.
      Parameters:
      obj - The vaccine to be added.
    • editVaccine

      public void editVaccine(Vaccine obj)
      This method is used to edit a vaccine in the database.
      Parameters:
      obj - The vaccine with the updated details.
    • deleteVaccine

      public void deleteVaccine(Vaccine obj)
      This method is used to delete a vaccine from the database.
      Parameters:
      obj - The vaccine to be deleted.
    • listVaccines

      public List<Vaccine> listVaccines()
      This method is used to retrieve a list of all vaccines from the database.
      Returns:
      A list of all vaccines.
    • searchVaccines

      public List<Vaccine> searchVaccines(String name)
      This method is used to search for vaccines by name.
      Parameters:
      name - The name of the vaccine to search for.
      Returns:
      A list of vaccines that match the provided name.
    • 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.