org.deltava.dao
Class GetAssignment

java.lang.Object
  extended by org.deltava.dao.DAO
      extended by org.deltava.dao.GetAssignment

public class GetAssignment
extends DAO

A Data Access Object to load Flight Assignments. All calls in this DAO will populate the legs for any returned Flight Assignments, but will not populate any Flight Reports.

Since:
1.0
Version:
2.6
Author:
Luke

Field Summary
 
Fields inherited from class org.deltava.dao.DAO
_ps, _queryMax, _queryStart, _queryTimeout
 
Constructor Summary
GetAssignment(Connection c)
          Initialize the Data Access Object.
 
Method Summary
 AssignmentInfo get(int id)
          Returns a Flight Assignment from the database.
 List<AssignmentInfo> getByEquipmentType(String eqType, int status)
          Return all Flight Assignment for a particular aircraft type and status.
 List<AssignmentInfo> getByEvent(int eventID, String dbName)
          Returns all Flight Assignments related to a particular Online Event.
 List<AssignmentInfo> getByPilot(int pilotID)
          Returns all Flight Assignments for a particular Pilot.
 List<AssignmentInfo> getByStatus(int status)
          Returns all Flight Assignments with a particular status.
 Collection<String> getEquipmentTypes()
          Returns the equipment types with Flight Assignments.
 
Methods inherited from class org.deltava.dao.DAO
commitTransaction, createTimestamp, executeUpdate, expandDate, formatDBName, getNewID, getQueryCount, prepareStatement, prepareStatementWithoutLimits, rollbackTransaction, setManualCommit, setQueryMax, setQueryStart, setQueryTimeout, startTransaction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GetAssignment

public GetAssignment(Connection c)
Initialize the Data Access Object.

Parameters:
c - the JDBC connection to use
Method Detail

get

public AssignmentInfo get(int id)
                   throws DAOException
Returns a Flight Assignment from the database.

Parameters:
id - the Assignment Database ID
Returns:
an Assignment bean, or null if not found
Throws:
DAOException - if a JDBC error occurs

getByPilot

public List<AssignmentInfo> getByPilot(int pilotID)
                                throws DAOException
Returns all Flight Assignments for a particular Pilot.

Parameters:
pilotID - the Pilot's database ID
Returns:
a List of AssignmentInfo beans
Throws:
DAOException - if a JDBC error occurs

getByStatus

public List<AssignmentInfo> getByStatus(int status)
                                 throws DAOException
Returns all Flight Assignments with a particular status.

Parameters:
status - the status code
Returns:
a List of AssignmentInfo beans
Throws:
DAOException - if a JDBC error occurs

getByEvent

public List<AssignmentInfo> getByEvent(int eventID,
                                       String dbName)
                                throws DAOException
Returns all Flight Assignments related to a particular Online Event.

Parameters:
eventID - the Event database ID
Returns:
a List of AssignmentInfo beans
Throws:
DAOException - if a JDBC error occurs

getByEquipmentType

public List<AssignmentInfo> getByEquipmentType(String eqType,
                                               int status)
                                        throws DAOException
Return all Flight Assignment for a particular aircraft type and status.

Parameters:
eqType - the Equipment type
status - the status code, or -1 if none
Returns:
a List of AssignmentInfo beans
Throws:
DAOException - if a JDBC error occurs

getEquipmentTypes

public Collection<String> getEquipmentTypes()
                                     throws DAOException
Returns the equipment types with Flight Assignments.

Returns:
a List of Equipment type codes
Throws:
DAOException - if a JDBC error occurs


Copyright © 2004-2009 Global Virtual Airlines Group. All Rights Reserved.