Class GetAcademyCourses

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

public class GetAcademyCourses extends DAO
A Data Access Object to load Flight Academy course data.
Since:
1.0
Version:
11.3
Author:
Luke
  • Constructor Details

    • GetAcademyCourses

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

    • get

      public Course get(int id) throws DAOException
      Returns a Flight Academy Course profile.
      Parameters:
      id - the database ID
      Returns:
      a Course bean, or null if not found
      Throws:
      DAOException - if a JDBC error occurs
    • getByName

      public Collection<Course> getByName(String name) throws DAOException
      Returns all Flight Academy Course profiles for a particular Certification.
      Parameters:
      name - the Certification name
      Returns:
      a Collection of Course beans
      Throws:
      DAOException - if a JDBC error occurs
    • getByCheckRide

      public List<Course> getByCheckRide(Collection<Integer> ids) throws DAOException
      Returns all Flight Academy Course profiles for particular Check Rides.
      Parameters:
      ids - a Collection of Check Ride database IDs
      Returns:
      a Collection of Course beans
      Throws:
      DAOException - if a JDBC error occurs
    • getByPilot

      public Collection<Course> getByPilot(int pilotID) throws DAOException
      Returns all Flight Academy Course profiles for a particular Pilot.
      Parameters:
      pilotID - the Pilot's database ID
      Returns:
      a Collection of Course beans
      Throws:
      DAOException - if a JDBC error occurs
    • getByInstructor

      public Collection<Course> getByInstructor(int instructorID, String sortBy) throws DAOException
      Returns all active or pending Flight Academy Course profiles for a particular Instructor.
      Parameters:
      instructorID - the Instructor's database ID
      sortBy - the sort column SQL
      Returns:
      a Collection of Course beans
      Throws:
      DAOException - if a JDBC error occurs
    • getCompleted

      public Collection<Course> getCompleted(int pilotID, String sortBy) throws DAOException
      Returns all completed Flight Academy Course profiles for a particular Pilot.
      Parameters:
      pilotID - the Pilot's database ID, or zero if all completed courses should be returned
      sortBy - the sort column SQL
      Returns:
      a Collection of Course beans
      Throws:
      DAOException - if a JDBC error occurs
    • getByStatus

      public Collection<Course> getByStatus(Status s, String sortBy, Certification c, String airlineCode) throws DAOException
      Returns all Flight Academy Course profiles with a particular status.
      Parameters:
      s - the Status
      sortBy - the sort column SQL
      c - the Certification, or null for all
      airlineCode - the virtual airline code, or null for all
      Returns:
      a Collection of Course beans
      Throws:
      DAOException - if a JDBC error occurs
    • getCompletionQueue

      public Collection<Course> getCompletionQueue() throws DAOException
      Returns all Flight Academy Courses ready for approval.
      Returns:
      a Collection of Course beans
      Throws:
      DAOException - if a JDBC error occurs
    • getCertifications

      public Map<Integer, Collection<String>> getCertifications(Collection<?> ids, boolean visibleOnly) throws DAOException
      Loads all Certifications obtained by a group of Pilots.
      Parameters:
      ids - a Collection of database IDs
      visibleOnly - TRUE if only visible certifications should be returned, otherwise FALSE
      Returns:
      a Map of comma-delimited certifications, indexed by database ID
      Throws:
      DAOException - if a JDBC error occurs
    • getAll

      public Collection<Course> getAll(String sortBy) throws DAOException
      Returns all Flight Academy Course profiles.
      Parameters:
      sortBy - the sort column SQL
      Returns:
      a Collection of Course beans
      Throws:
      DAOException - if a JDBC error occurs