Class CustomersDAO

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

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

    • CustomersDAO

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

    • addCustomer

      public void addCustomer(Customers obj)
      This method adds a customer to the database.
      Parameters:
      obj - The customer object to be added.
    • editCustomer

      public void editCustomer(Customers obj)
      This method edits a customer in the database.
      Parameters:
      obj - The customer object to be edited.
    • deleteCustomer

      public void deleteCustomer(Customers obj)
      This method deletes a customer from the database.
      Parameters:
      obj - The customer object to be deleted.
    • listCustomers

      public List<Customers> listCustomers()
      This method lists all customers in the database.
      Returns:
      A list of all customers in the database.
    • searchCustomer

      public List<Customers> searchCustomer(String name)
      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

      public Customers searchCustomerByCPF(String cpf)
      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

      public Customers consultCustomers(String name)
      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.