Class SetAssignment

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

public class SetAssignment extends DAO
A Data Access Object to create and update Flight Assignments.
Since:
1.0
Version:
10.6
Author:
Luke
  • Constructor Details

    • SetAssignment

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

    • write

      public void write(AssignmentInfo a, String db) throws DAOException
      Writes a new Flight Assignment to the database. Any FlightReport beans within the assignment will have the Assignment Database ID updated.
      Parameters:
      a - the Assingment object
      db - the Database to write to
      Throws:
      DAOException - if a JDBC error occurs
    • assign

      public void assign(AssignmentInfo a, int pilotID, String db) throws DAOException
      Assigns a Flight Assignment to a particular Pilot.
      Parameters:
      a - the Assignment, with status and assignDate properties set
      pilotID - the Pilot's Database ID
      db - the Database to write to
      Throws:
      DAOException - if a JDBC error occurs
    • complete

      public void complete(AssignmentInfo ai, boolean allowIncomplete) throws DAOException
      Marks an Assignment as Complete.
      Parameters:
      ai - the AssignmentInfo object
      allowIncomplete - TRUE if uncompleted flights are allowed (like when releasing an assignment), otherwise FALSE
      Throws:
      DAOException - if a JDBC error occurs, or draft flights are found when not allowed
    • reset

      public void reset(AssignmentInfo a) throws DAOException
      Releases a Flight Assignment.
      Parameters:
      a - the Flight Assignment bean
      Throws:
      DAOException - if a JDBC error occurs
    • delete

      public void delete(AssignmentInfo a) throws DAOException
      Deletes a Flight Assignment from the database.
      Parameters:
      a - the Assignment
      Throws:
      DAOException - if a JDBC error occurs
    • write

      public void write(CharterRequest req) throws DAOException
      Writes a Charter flight request to the database.
      Parameters:
      req - the CharterRequest
      Throws:
      DAOException - if a JDBC error occurs
    • delete

      public void delete(CharterRequest req) throws DAOException
      Deletes a Charter flight request from the database.
      Parameters:
      req - the CharterRequest
      Throws:
      DAOException - if a JDBC error occurs