Class GetPilot
java.lang.Object
org.deltava.dao.DAO
org.deltava.dao.PilotReadDAO
org.deltava.dao.GetPilot
- Direct Known Subclasses:
GetPilotDirectory
,GetPilotNotify
,GetPilotRecognition
A Data Access Object to get Pilots from the database, for use in roster operations.
- Since:
- 1.0
- Version:
- 11.1
- Author:
- Luke
-
Field Summary
Fields inherited from class org.deltava.dao.PilotReadDAO
_cache
Fields inherited from class org.deltava.dao.DAO
_queryMax, _queryStart, _queryTimeout, WGS84_SRID
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetActivePilots
(String orderBy) Returns all Active and On Leave Pilots.getByEMail
(String eMail) Gets a Pilot based on e-mail address.Returns pilots who have enabled currency-based Check Rides.Gets the newest pilots (with the highest pilot IDs).getPilotByCode
(int pilotCode, String dbName) Gets a Pilot based on a pilot code.Returns all Pilots.getPilotsByEQ
(EquipmentType eq, String sortBy, boolean showActive, Rank rank) Returns all active Pilots with a particular rank in a particular equipment program.getPilotsByLetter
(String letter) Returns Pilots whose last name begins with a particular letter.getPilotsByRank
(Rank rank) Returns all Active pilots with a particular rank.getPilotsByStatus
(PilotStatus status) Returns Pilots based upon their status.Searches for Pilots matching certain name criteria, using a SQL LIKE search.Searches for Pilots matching certain search criteria, using a SQL LIKE search.Methods inherited from class org.deltava.dao.PilotReadDAO
execute, get, get, get, getByID, getByName, loadAccomplishments, loadChildRows, loadIMAddrs, loadPushEndpoints, loadRatings, loadRoles, updatePilotCodes
Methods inherited from class org.deltava.dao.DAO
commitTransaction, createTimestamp, executeIDs, executeUpdate, executeUpdate, expandDate, formatDBName, formatLocation, getNewID, getQueryCount, prepare, prepareWithoutLimits, rollbackTransaction, setQueryMax, setQueryStart, setQueryTimeout, startTransaction, toID, toID, toInstant
-
Constructor Details
-
GetPilot
Creates the DAO from a JDBC connection.- Parameters:
c
- the JDBC connection to use
-
-
Method Details
-
getNewestPilots
Gets the newest pilots (with the highest pilot IDs).- Returns:
- a List of Pilots
- Throws:
DAOException
- if a JDBC error occurs
-
getCurrencyPilots
Returns pilots who have enabled currency-based Check Rides.- Returns:
- a List of Pilots
- Throws:
DAOException
- if a JDBC error occurs
-
getByEMail
Gets a Pilot based on e-mail address.- Parameters:
eMail
- the e-mail address- Returns:
- a Pilot, or null if not found
- Throws:
DAOException
- if a JDBC error occurs
-
getPilotByCode
Gets a Pilot based on a pilot code. This populates ratings and roles.- Parameters:
pilotCode
- the pilot code to search for (eg. 123 for DVA123).dbName
- the database name- Returns:
- the Pilot object, or null if the pilot code was not found
- Throws:
DAOException
- if a JDBC error occurs
-
getActivePilots
Returns all Active and On Leave Pilots.- Parameters:
orderBy
- the database column to sort the results by- Returns:
- a List of all active/on leave Pilots
- Throws:
DAOException
- if a JDBC error occurs
-
getPilotsByEQ
public List<Pilot> getPilotsByEQ(EquipmentType eq, String sortBy, boolean showActive, Rank rank) throws DAOException Returns all active Pilots with a particular rank in a particular equipment program.- Parameters:
eq
- the EquipmentType beansortBy
- an optional sort SQL snippetshowActive
- TRUE if only active pilots should be displayed, otherwise FALSErank
- the Rank- Returns:
- a List of Pilots in a particular equipment type
- Throws:
DAOException
- if a JDBC error occurs
-
getPilotsByRank
Returns all Active pilots with a particular rank.- Parameters:
rank
- the rank- Returns:
- a List of active Pilots with a particular rank
- Throws:
DAOException
- if a JDBC error occurs
-
getPilotsByLetter
Returns Pilots whose last name begins with a particular letter.- Parameters:
letter
- the first Letter of the last name- Returns:
- a List of Pilots
- Throws:
DAOException
- if a JDBC error occursIllegalArgumentException
- if letter isn't a letter according toCharacter.isLetter(char)
NullPointerException
- if letter is null
-
getPilotsByStatus
Returns Pilots based upon their status.- Parameters:
status
- a PilotStatus- Returns:
- a List of Pilots
- Throws:
DAOException
- if a JDBC error occurs
-
getPilots
Returns all Pilots.- Returns:
- a List of Pilots
- Throws:
DAOException
- if a JDBC error occurs
-
search
Searches for Pilots matching certain name criteria, using a SQL LIKE search.- Parameters:
dbName
- the database namefName
- the Pilot's First Name, containing wildcards accepted by the JDBC implementation's LIKE operatorlName
- the Pilot's Last Name, containing wildcards accepted by the JDBC implementation's LIKE operator- Returns:
- a List of Pilots
- Throws:
DAOException
- if a JDBC error occurs
-
search
public List<Pilot> search(String dbName, String fName, String lName, String eMail, Collection<String> ratings) throws DAOException Searches for Pilots matching certain search criteria, using a SQL LIKE search.- Parameters:
dbName
- the database namefName
- the Pilot's First Name, containing wildcards accepted by the JDBC implementation's LIKE operatorlName
- the Pilot's Last Name, containing wildcards accepted by the JDBC implementation's LIKE operatoreMail
- the Pilot's e-mail Address, , containing wildcards accepted by the JDBC implementation's LIKE operatorratings
- a Collection of Ratings which the Pilots need to have- Returns:
- a List of Pilots
- Throws:
DAOException
- if a JDBC error occurs
-