Class EmployeesDAO

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

public class EmployeesDAO extends Object
This class is responsible for managing the data access for the Employees in the application. It provides methods to add, edit, delete, list, and search employees in the database. It also provides a method to authenticate an employee.
  • Constructor Details

    • EmployeesDAO

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

    • addEmployees

      public void addEmployees(Employees obj)
      This method is used to add a new employee to the database.
      Parameters:
      obj - The employee to be added.
    • editEmployees

      public void editEmployees(Employees obj)
      This method is used to edit the details of an existing employee in the database.
      Parameters:
      obj - The employee with the updated details.
    • deleteEmployees

      public void deleteEmployees(Employees obj)
      This method is used to delete an employee from the database.
      Parameters:
      obj - The employee to be deleted.
    • listEmployees

      public List<Employees> listEmployees()
      This method is used to retrieve a list of all employees from the database.
      Returns:
      A list of all employees.
    • searchEmployees

      public List<Employees> searchEmployees(String name)
      This method is used to search for employees by name.
      Parameters:
      name - The name of the employee to search for.
      Returns:
      A list of employees that match the provided name.
    • toLogin

      public boolean toLogin(String email, String password)
      This method is used to authenticate an employee by email and password.
      Parameters:
      email - The email of the employee to authenticate.
      password - The password of the employee to authenticate.
      Returns:
      true if the employee is authenticated, false otherwise.
    • searchEmployeeByCPF

      public Employees searchEmployeeByCPF(String cpf)
      This method searches for an employee in the database by CPF.
      Parameters:
      cpf - The CPF of the employee to be searched.
      Returns:
      The employee with the CPF searched.