Class GetExam
java.lang.Object
org.deltava.dao.DAO
org.deltava.dao.GetExam
A Data Access Object for loading Examination/Check Ride data.
- Since:
- 1.0
- Version:
- 11.2
- Author:
- Luke
-
Field Summary
Fields inherited from class DAO
_queryMax, _queryStart, _queryTimeout, WGS84_SRIDModifier and TypeFieldDescriptionprotected intThe maximum number of rows to return.protected intThe row number at which to start returning results.protected intThe query timeout, in seconds.protected static final intThe SRID used for geolocation queries. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAcademyCheckRides(int courseID) Loads all Check Rides for a particular Flight Academy Course.getAcademyCheckRides(int courseID, TestStatus status) Loads all Check Rides for a particular Flight Academy Course.getACARSCheckRide(int acarsID) Loads a Pilot Check Ride associated with a particular ACARS Flight ID.intgetActiveExam(int id) Checks if a Pilot has an Examination open or awaiting scoring.getAutoScored(String examName) Returns automatically scored Examiantions.Returns the names of all automatically scored examinations.getCheckRide(int id) Loads a Pilot Check Ride.getCheckRide(int pilotID, String eqType, TestStatus status) Loads a pending Pilot Check Ride for a particular equipment type.getCheckRideQueue(boolean isAcademy) Returns all submitted Check Rides for the current airline or the Flight Academy.getCheckRides(int pilotID) Loads all Check Rides for a particular Pilot.getExam(int id) Loads a Pilot Examination.getExams(int id) Loads all examinations and check rides for a particular Pilot.getExamTimes(boolean isAcademy) Returns the minimum and maximum time available to take Examinations.getPendingRides(int days, RideType rt) Returns all unsubmitted Check Rides older than a certain date.Returns all Initial Questionnaires for hired Pilots.Loads all submitted Examinations.Returns all unsubmitted Check Rides for the current airline.Methods inherited from class DAO
commitTransaction, createTimestamp, executeIDs, executeUpdate, executeUpdate, expandDate, formatDBName, formatLocation, getNewID, getQueryCount, prepare, prepareWithoutLimits, rollbackTransaction, setQueryMax, setQueryStart, setQueryTimeout, startTransaction, toID, toID, toInstantModifier and TypeMethodDescriptionprotected voidCommits a multi-step transaction to the database.protected static TimestampNull-safe conversion of an Instant to a Timestamp.Helper method to extract database ID data from the result set.protected static intexecuteUpdate(PreparedStatement ps, int minUpdateCount) Executes an UPDATE transaction on a prepared statement, and throws aSQLExceptionif less than the expected number of rows were updated.protected static intexecuteUpdate(PreparedStatement ps, int minPerUpdate, int minTotal) Executes an batched UPDATE transaction on a prepared statement, and throws aSQLExceptionif less than the expected number of rows were updated per batch entry.protected static InstantexpandDate(Date dt) Converts a date-only JDBC value into a full timestamp.protected static StringformatDBName(String db) Formats a database name by converting to lowercase.protected static StringConverts a geographic location into a MySQL WKT formatted point.protected intgetNewID()Returns the AUTO_INC column value generated by the previous JDBC transaction.static final longReturns the total number of queries executed since the JVM was started.protected PreparedStatementInitialize the prepared statement with an arbitrary SQL statement.protected PreparedStatementInitialize the prepared statement with an abitrary SQL statement, without applying the DAO's query result limitations.protected voidRolls back a multi-step transaction before it is completed.final voidsetQueryMax(int maxRows) Sets the maximum number of rows in the returned result set.final voidsetQueryStart(int rowStart) Sets the first row of the results to return.voidsetQueryTimeout(int timeout) Sets the timeout for any SQL operations.protected voidMarks the start of a multi-step database transaction.protected static IntegerConverts a Database bean or an Integer into an Integer.protected static Collection<Integer> toID(Collection<?> ids) Converts a collection of Objects into Integer IDs.protected static InstantNull-safe conversion of a Timestamp to an Instant.
-
Constructor Details
-
GetExam
Initialize the Data Access Object.- Parameters:
c- the JDBC connection to use
-
-
Method Details
-
getExam
Loads a Pilot Examination.- Parameters:
id- the Database ID- Returns:
- the Examination, or null if not found
- Throws:
DAOException- if a JDBC error occurs
-
getCheckRide
Loads a Pilot Check Ride.- Parameters:
id- the Database ID- Returns:
- the CheckRide, or null if not found
- Throws:
DAOException- if a JDBC error occurs
-
getACARSCheckRide
Loads a Pilot Check Ride associated with a particular ACARS Flight ID.- Parameters:
acarsID- the ACARS flight ID- Returns:
- a CheckRide, or null if not found
- Throws:
DAOException- if a JDBC error occurs
-
getAcademyCheckRides
Loads all Check Rides for a particular Flight Academy Course.- Parameters:
courseID- the Course database ID- Returns:
- a List of CheckRide beans
- Throws:
DAOException- if a JDBC error occurs
-
getAcademyCheckRides
Loads all Check Rides for a particular Flight Academy Course.- Parameters:
courseID- the Course database IDstatus- the CheckRide status, or null for all- Returns:
- a List of CheckRide beans
- Throws:
DAOException- if a JDBC error occurs
-
getCheckRide
Loads a pending Pilot Check Ride for a particular equipment type.- Parameters:
pilotID- the Pilot Database IDeqType- the equipment type usedstatus- the CheckRide status- Returns:
- a CheckRide, or null if not found
- Throws:
DAOException- if a JDBC error occurs
-
getCheckRides
Loads all Check Rides for a particular Pilot.- Parameters:
pilotID- the pilot Database ID- Returns:
- a List of CheckRide beans
- Throws:
DAOException- if a JDBC error occurs
-
getSubmittedRides
Returns all unsubmitted Check Rides for the current airline.- Returns:
- a List of CheckRide beans
- Throws:
DAOException- if a JDBC error occurs
-
getPendingRides
Returns all unsubmitted Check Rides older than a certain date.- Parameters:
days- the number of daysrt- a RideType- Returns:
- a List of CheckRide beans
- Throws:
DAOException- if a JDBC error occurs
-
getCheckRideQueue
Returns all submitted Check Rides for the current airline or the Flight Academy.- Parameters:
isAcademy- TRUE if listing Flight Academy Check Rides, otherwise FALSE- Returns:
- a Collection of CheckRide beans
- Throws:
DAOException- if a JDBC error occurs
-
getExams
Loads all examinations and check rides for a particular Pilot.- Parameters:
id- the Pilot's Database ID- Returns:
- a List of Tests
- Throws:
DAOException- if a JDBC error occurs
-
getAutoScored
Returns automatically scored Examiantions.- Parameters:
examName- the Examination name, or null if all requested- Returns:
- a Collection of Examination beans
- Throws:
DAOException- if a JDBC error occurs
-
getAutoScoredExamNames
Returns the names of all automatically scored examinations.- Returns:
- a Collection of Examination names
- Throws:
DAOException- if a JDBC error occurs
-
getQuestionnaires
Returns all Initial Questionnaires for hired Pilots.- Parameters:
ids- a Collection of Pilot database IDs- Returns:
- a Map of Examination beans keyed by Pilot ID
- Throws:
DAOException- if a JDBC error occurs
-
getSubmitted
Loads all submitted Examinations.- Returns:
- a List of Examinations
- Throws:
DAOException- if a JDBC error occurs
-
getActiveExam
Checks if a Pilot has an Examination open or awaiting scoring.- Parameters:
id- the Pilot's database ID- Returns:
- TRUE if an Examination is in NEW or SUBMITTED status
- Throws:
DAOException- if a JDBC error occurs
-
getExamTimes
Returns the minimum and maximum time available to take Examinations.- Parameters:
isAcademy- TRUE for Flight Academy examinations, FALSE for non-Academy- Returns:
- a Tuple with the minimum and maximum times, in minutes
- Throws:
DAOException- if a JDBC error occurs
-