Class PetsDAO
java.lang.Object
br.com.pethub.dao.PetsDAO
This class is responsible for managing the data access for the Pets in the application.
It provides methods to add, edit, delete, list, and search pets in the database.
It also provides methods to get pets by customer, get pet by name, delete pets by customer id, and generate an animal report.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
This method is used to add a new pet to the database.void
animalReport
(int petId) This method is used to generate an animal report for a pet.void
deletePets
(Pets obj) This method is used to delete a pet from the database.void
deletePetsByCustomerId
(int customerId) This method is used to delete pets by customer id.void
This method is used to edit the details of an existing pet in the database.getPetByName
(String name) This method is used to get a pet by name.getPetsByCustomer
(Customers customer) This method is used to get pets by customer.listPets()
This method is used to retrieve a list of all pets from the database.searchPets
(String name) This method is used to search for pets by name.
-
Constructor Details
-
PetsDAO
public PetsDAO()The constructor method of the PetsDAO class.
-
-
Method Details
-
addPets
This method is used to add a new pet to the database.- Parameters:
obj
- The pet to be added.
-
editPets
This method is used to edit the details of an existing pet in the database.- Parameters:
obj
- The pet with the updated details.
-
deletePets
This method is used to delete a pet from the database.- Parameters:
obj
- The pet to be deleted.
-
listPets
-
searchPets
-
getPetsByCustomer
-
getPetByName
-
deletePetsByCustomerId
public void deletePetsByCustomerId(int customerId) This method is used to delete pets by customer id.- Parameters:
customerId
- The id of the customer to delete pets for.
-
animalReport
public void animalReport(int petId) This method is used to generate an animal report for a pet.- Parameters:
petId
- The id of the pet to generate a report for.
-