Package scheduler.Dao
Class daoCustomer
- java.lang.Object
-
- scheduler.Dao.daoCustomer
-
public abstract class daoCustomer extends java.lang.Object
Class that provides functionality on the persistence layer for the "Customer" class that manages business local in the model package.
-
-
Constructor Summary
Constructors Constructor Description daoCustomer()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addCustomerDAO(Customer customer)
Adds a customer to the DB.static boolean
deleteCustomerDAO(Customer C)
Deletes the given customerstatic javafx.collections.ObservableList<Country>
getAllcountriesDAO()
Gets a current list of all countries from the databasestatic javafx.collections.ObservableList<Customer>
getAllCustomersDAO()
Get's all needed values for the customer object, and provides an Observable list for use by the application.static Country
getCountryDAO(int Country_ID)
Given a country_id returns the Country objectstatic Division
getDivisionDAO(int division_id)
Given a division ID value, returns a division objectstatic javafx.collections.ObservableList<Division>
getDivisionDAO(Country country_id)
Returns an list of Division ID's for the given Country IDstatic Customer
returnCustomerDAO(int id)
Given a customer id returns a customer objectstatic java.lang.String
returnCustomerNameDAO(int CustID)
Returns the Name of a customer given a customer idstatic void
updateCustomerDAO(Customer C)
Updates a Customer's information in the Database.
-
-
-
Method Detail
-
getAllCustomersDAO
public static javafx.collections.ObservableList<Customer> getAllCustomersDAO() throws java.sql.SQLException
Get's all needed values for the customer object, and provides an Observable list for use by the application.- Returns:
- An Observable Array List of All Customers.
- Throws:
java.sql.SQLException
- if an error occurs.
-
addCustomerDAO
public static void addCustomerDAO(Customer customer)
Adds a customer to the DB. It is assumed all error checking has already been made against business logic.- Parameters:
customer
- Customer object will all components added.
-
getAllcountriesDAO
public static javafx.collections.ObservableList<Country> getAllcountriesDAO()
Gets a current list of all countries from the database- Returns:
- an Observable list of countries
-
getCountryDAO
public static Country getCountryDAO(int Country_ID)
Given a country_id returns the Country object- Parameters:
Country_ID
- Integer, country id- Returns:
- Country object associated with the given id
-
getDivisionDAO
public static Division getDivisionDAO(int division_id)
Given a division ID value, returns a division object- Parameters:
division_id
- id number- Returns:
- division object
-
getDivisionDAO
public static javafx.collections.ObservableList<Division> getDivisionDAO(Country country_id)
Returns an list of Division ID's for the given Country ID- Parameters:
country_id
- of the country for which you would like to obtain division id's- Returns:
- an Observable list of Division ID's.
-
deleteCustomerDAO
public static boolean deleteCustomerDAO(Customer C)
Deletes the given customer- Parameters:
C
- is a customer object- Returns:
- true after the operation is completed.
-
updateCustomerDAO
public static void updateCustomerDAO(Customer C)
Updates a Customer's information in the Database.- Parameters:
C
- Customer object record.
-
returnCustomerNameDAO
public static java.lang.String returnCustomerNameDAO(int CustID)
Returns the Name of a customer given a customer id- Parameters:
CustID
- Integer, Customer ID- Returns:
- String, customer name
-
returnCustomerDAO
public static Customer returnCustomerDAO(int id)
Given a customer id returns a customer object- Parameters:
id
- Integer, customer id- Returns:
- Customer object
-
-