Package br.com.pethub.dao
Class CustomersDAO
java.lang.Object
br.com.pethub.dao.CustomersDAO
This class is responsible for managing the data access for the Customers in the application.
It provides methods to add, edit, delete, list, and search customers in the database.
It also provides a method to generate a report of all customers.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addCustomer
(Customers obj) This method adds a customer to the database.void
This method generates a report of all customers in the database.consultCustomers
(String name) This method is used to consult a customer by name.void
deleteCustomer
(Customers obj) This method deletes a customer from the database.void
editCustomer
(Customers obj) This method edits a customer in the database.This method lists all customers in the database.searchCustomer
(String name) This method searches for a customer in the database by name.This method searches for a customer in the database by CPF.
-
Constructor Details
-
CustomersDAO
public CustomersDAO()The constructor method of the CustomersDAO class.
-
-
Method Details
-
addCustomer
This method adds a customer to the database.- Parameters:
obj
- The customer object to be added.
-
editCustomer
This method edits a customer in the database.- Parameters:
obj
- The customer object to be edited.
-
deleteCustomer
This method deletes a customer from the database.- Parameters:
obj
- The customer object to be deleted.
-
listCustomers
This method lists all customers in the database.- Returns:
- A list of all customers in the database.
-
searchCustomer
This method searches for a customer in the database by name.- Parameters:
name
- The name of the customer to be searched.- Returns:
- A list of customers with the name searched.
-
searchCustomerByCPF
This method searches for a customer in the database by CPF.- Parameters:
cpf
- The CPF of the customer to be searched.- Returns:
- The customer with the CPF searched.
-
consultCustomers
This method is used to consult a customer by name.- Parameters:
name
- The name of the customer to consult.- Returns:
- The customer that matches the provided name, or null if no match is found.
-
clientsReport
public void clientsReport()This method generates a report of all customers in the database.
-