Package scheduler.Dao
Class daoAppointment
- java.lang.Object
-
- scheduler.Dao.daoAppointment
-
public abstract class daoAppointment extends java.lang.Object
Class that provides functionality on the persistence layer for the "Appointment" class where business logic is implemented.
-
-
Constructor Summary
Constructors Constructor Description daoAppointment()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addAppointmentDAO(Appointment A)
Adds an appointment to the database.static java.util.LinkedList<Appointment>
allAppointmentsByCustomerDAO(int CustomerID)
Returns a linked list of all the appointments that belong to a specific customerstatic Appointment
appointmentWithinFifteenDAO()
Queries the database to see if there are any upcoming appointments within the next 15 minutes.static void
deleteAppointmentDAO(Appointment A)
Delete an appointment recordstatic javafx.collections.ObservableList<Appointment>
getAllAppointmentsDAO()
Returns all appointments that currently existstatic javafx.collections.ObservableList<Contact>
getAllContactsDAO()
Returns all Contacts to the applicationstatic Contact
getContactByIDDAO(int id)
Returns a contact object, given their IDstatic void
modifyAppointmentDAO(Appointment A)
Modifies an existing Appointment recordstatic javafx.collections.ObservableList<Appointment>
returnAppointmentsByDayIntervalDAO(int interval)
Returns a view of appointments with start dates in the next x days.
-
-
-
Method Detail
-
getAllContactsDAO
public static javafx.collections.ObservableList<Contact> getAllContactsDAO()
Returns all Contacts to the application- Returns:
- an observable list
-
getAllAppointmentsDAO
public static javafx.collections.ObservableList<Appointment> getAllAppointmentsDAO()
Returns all appointments that currently exist- Returns:
- Observable list of all appointments
-
getContactByIDDAO
public static Contact getContactByIDDAO(int id)
Returns a contact object, given their ID- Parameters:
id
- Integer, ContactID- Returns:
- Corresponding Contact object
-
addAppointmentDAO
public static void addAppointmentDAO(Appointment A)
Adds an appointment to the database. Assumes validation has been completed and that this is not a duplicate of another appointment.- Parameters:
A
- appointment object.
-
modifyAppointmentDAO
public static void modifyAppointmentDAO(Appointment A)
Modifies an existing Appointment record- Parameters:
A
- , an appointment object.
-
deleteAppointmentDAO
public static void deleteAppointmentDAO(Appointment A)
Delete an appointment record- Parameters:
A
- is an appointment record to delete.
-
allAppointmentsByCustomerDAO
public static java.util.LinkedList<Appointment> allAppointmentsByCustomerDAO(int CustomerID)
Returns a linked list of all the appointments that belong to a specific customer- Parameters:
CustomerID
- , Integer Customer ID- Returns:
- Linked list of Appointment objects. If the linked list is empty there were no results.
-
appointmentWithinFifteenDAO
public static Appointment appointmentWithinFifteenDAO()
Queries the database to see if there are any upcoming appointments within the next 15 minutes. If it finds an appointment that occurs within 15 minutes, it will return the first appointment it finds that meets the criteria. Note: there is the possibility that there could be more than one appointment coming up in the next 15 minutes. This only reports the first found result.- Returns:
- An appointment object. Will return an appointment object with Appointment ID of 0 if a upcoming appointment is not found
-
returnAppointmentsByDayIntervalDAO
public static javafx.collections.ObservableList<Appointment> returnAppointmentsByDayIntervalDAO(int interval)
Returns a view of appointments with start dates in the next x days.- Parameters:
interval
- the number of days in the future you would like to view appointments for. Calculation is now + interval of day provided- Returns:
- Observable list of appointments. Returns an empty list if there are no upcoming appointments in the stated time period.
-
-