Class GetTour

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

public class GetTour extends DAO
A Data Access Object to read Tour data from the database.
Since:
10.0
Version:
11.6
Author:
Luke
  • Constructor Details

    • GetTour

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

    • get

      public Tour get(int id, String dbName) throws DAOException
      Loads a Tour from the database.
      Parameters:
      id - the database ID
      dbName - the database name
      Returns:
      a Tour or null if not found
      Throws:
      DAOException
    • getAll

      public Collection<Tour> getAll() throws DAOException
      Retrieves all Tours from the database.
      Returns:
      a Collection of Tour beans
      Throws:
      DAOException - if a JDBC error occurs
    • getWithFlights

      public Collection<Tour> getWithFlights() throws DAOException
      Retrieves all Tours from the database that have at least one Flight Report linked to them.
      Returns:
      a Collection of Tour beans
      Throws:
      DAOException - if a JDBC error occurs
    • getWithFeedback

      public Collection<Tour> getWithFeedback() throws DAOException
      Retrieves all Tours from the database that have user feedback.
      Returns:
      a Collection of Tour beans
      Throws:
      DAOException - if a JDBC error occurs
    • getProgress

      public Collection<TourProgress> getProgress(int tourID) throws DAOException
      Returns progress by Pilot for a particular Tour.
      Parameters:
      tourID - the Tour database ID
      Returns:
      a Collection of TourProgress beans
      Throws:
      DAOException - if a JDBC error occurs
    • getPilotProgress

      public Collection<TourProgress> getPilotProgress(int pilotID, String dbName) throws DAOException
      Returns the number of Flights Legs in each Flight Tour completed by a particular Pilot.
      Parameters:
      pilotID - the Pilot's database ID
      dbName - the database name
      Returns:
      a Collection of TourProgress beans
      Throws:
      DAOException - if a JDBC error occurs
    • findLeg

      public List<Tour> findLeg(RoutePair rp, Instant dt, String dbName) throws DAOException
      Retrieves all Tours that contain a particular Flight leg.
      Parameters:
      rp - the RoutePair
      dt - the flight date
      dbName - the database name
      Returns:
      a List of Tour beans, sorted by descending matching leg number
      Throws:
      DAOException - if a JDBC error occurs