Class GetCharterRequests

java.lang.Object
org.deltava.dao.DAO
org.deltava.dao.GetCharterRequests

public class GetCharterRequests extends DAO
A Data Access Object to retrieve Charter flight requests from the database.
Since:
10.0
Version:
10.0
Author:
Luke
  • Constructor Details

    • GetCharterRequests

      public GetCharterRequests(Connection c)
      Initializes the Data Access Object.
      Parameters:
      c - the JDBC connection to use
  • Method Details

    • get

      public CharterRequest get(int id) throws DAOException
      Retrieves a specific Charter request from the database.
      Parameters:
      id - the request database ID
      Returns:
      the CharterRequest, or null if not found
      Throws:
      DAOException - if a JDBC error occurs
    • getAll

      public List<CharterRequest> getAll() throws DAOException
      Retrieves all Charter requests from the database.
      Returns:
      a List of CharterRequest beans
      Throws:
      DAOException - if a JDBC error occurs
    • getPendingCount

      public int getPendingCount() throws DAOException
      Returns the number of pending Charter requests.
      Returns:
      the number of pending requests
      Throws:
      DAOException - if a JDBC error occurs
    • getPilotIDs

      public Collection<Integer> getPilotIDs() throws DAOException
      Returns the database IDs of all Pilots who have created a Charter flight Request.
      Returns:
      a Collection of database IDs
      Throws:
      DAOException - if a JDBC error occurs
    • getByPilot

      public List<CharterRequest> getByPilot(int pilotID) throws DAOException
      Retrieves all Charter requests for a specific Pilot from the database.
      Parameters:
      pilotID - the Pilot database ID
      Returns:
      a List of CharterRequest beans
      Throws:
      DAOException - if a JDBC error occurs