Package Database

Class CustomerDataAccessObject

java.lang.Object
Database.CustomerDataAccessObject

public class CustomerDataAccessObject extends Object
Class representing all the methods to query the customers table
  • Constructor Details

    • CustomerDataAccessObject

      public CustomerDataAccessObject()
  • Method Details

    • getCustomerByCustomerID

      public static Customer getCustomerByCustomerID(int _customerId) throws SQLException
      This function queries a customer
      Parameters:
      _customerId - the customerID int value
      Returns:
      the Customer object
      Throws:
      SQLException
    • getAllCustomers

      public static javafx.collections.ObservableList<Customer> getAllCustomers() throws SQLException
      This function queries a list of customers
      Returns:
      [ObservableList] of Customer objects
      Throws:
      SQLException
    • getCustomerByDivisionID

      public static javafx.collections.ObservableList<Customer> getCustomerByDivisionID(int _divisionId) throws SQLException
      This function queries a list of customers
      Parameters:
      _divisionId - the divisionID int value
      Returns:
      [ObservableList] of Customer objects
      Throws:
      SQLException
    • deleteCustomerByCustomerID

      public static void deleteCustomerByCustomerID(int _customerId) throws SQLException
      This function deletes a customer record
      Parameters:
      _customerId - the customerID int value
      Throws:
      SQLException
    • deleteCustomerByDivisionID

      public static void deleteCustomerByDivisionID(int _divisionId) throws SQLException
      This function deletes a customer record
      Parameters:
      _divisionId - the divisionId int value
      Throws:
      SQLException
    • addCustomer

      public static void addCustomer(Customer _customer)
      This function adds a customer record
      Parameters:
      _customer - the Customer object
    • updateCustomer

      public static void updateCustomer(Customer _customer)
      This function update a customer record
      Parameters:
      _customer - the Customer object