Class GetElite
java.lang.Object
org.deltava.dao.DAO
org.deltava.dao.EliteDAO
org.deltava.dao.GetElite
A Data Access Object to load Elite status levels.
- Since:
- 9.2
- Version:
- 11.5
- Author:
- Luke
-
Field Summary
Fields inherited from class org.deltava.dao.DAO
_queryMax, _queryStart, _queryTimeout, WGS84_SRID
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAllLifetimeStatus
(int pilotID, String dbName) Returns all lifetime Elite status for a particular Pilot.getAllStatus
(int pilotID, int year) Loads a Pilot's Elite status updates for a particular year.Returns all Elite status levels.getLevels
(int year) Returns Elite status levels for a given year.Returns all Lifetime status levels.getLifetimeStatus
(int pilotID, String dbName) Returns the most recent lifetime Elite status for a particular Pilot.getLifetimeStatus
(Collection<?> IDs, String dbName) Retrieves Elite lifetime program status for a number of Pilots.int
getPilotCount
(EliteLevel lvl) Counts the number of Pilots who have achieved a given Elite status level.int
Counts the number of Pilots who have achieved a given lifetime Elite status level.getPilots
(EliteLevel lvl) Loads all Pilots who have obtained a particular Elite status in a given year.Loads all Pilots who have obtained a particular lifetime Elite status.getStatus
(int pilotID, int year) Loads a Pilot's most recent Elite status for a given year.getStatus
(Collection<?> IDs, int year, String dbName) Retrieves Elite program status for a number of Pilots.Methods inherited from class org.deltava.dao.EliteDAO
executeLevel, executeLifetime, get, getLifetime, populateLevels
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
-
GetElite
Initializes the Data Access Object.- Parameters:
c
- the JDBC connection to use
-
-
Method Details
-
getLevels
Returns all Elite status levels.- Returns:
- a List of EliteLevel beans
- Throws:
DAOException
- if a JDBC error occurs
-
getLevels
Returns Elite status levels for a given year.- Parameters:
year
- the program year- Returns:
- a TreeSet of EliteLevel beans, in ascending order
- Throws:
DAOException
- if a JDBC error occurs
-
getLifetimeLevels
Returns all Lifetime status levels.- Returns:
- a TreeSet of EliteLifetime beans, in asecnding order
- Throws:
DAOException
- if a JDBC error occurs
-
getLifetimeStatus
public Map<Integer, EliteLifetimeStatus> getLifetimeStatus(Collection<?> IDs, String dbName) throws DAOException Retrieves Elite lifetime program status for a number of Pilots.- Parameters:
IDs
- a Collection of pilot IDs. This can either be a Collection of Integers, a Collection ofDatabaseBean
beansdbName
- the database name- Returns:
- a Map of EliteLifetimeStatus beans for the specified year, keyed by Pilot database ID
- Throws:
DAOException
- if a JDBC error occurs
-
getStatus
public Map<Integer, EliteStatus> getStatus(Collection<?> IDs, int year, String dbName) throws DAOException Retrieves Elite program status for a number of Pilots.- Parameters:
IDs
- a Collection of pilot IDs. This can either be a Collection of Integers, a Collection ofDatabaseBean
beansyear
- the plan yeardbName
- the database name- Returns:
- a Map of EliteStatus beans for the specified year, keyed by Pilot database ID
- Throws:
DAOException
- if a JDBC error occurs
-
getLifetimeStatus
Returns the most recent lifetime Elite status for a particular Pilot.- Parameters:
pilotID
- the Pilot database IDdbName
- the database name- Returns:
- an EliteLifetime bean, or null if no status
- Throws:
DAOException
- if a JDBC error occurs
-
getAllLifetimeStatus
public List<EliteLifetimeStatus> getAllLifetimeStatus(int pilotID, String dbName) throws DAOException Returns all lifetime Elite status for a particular Pilot.- Parameters:
pilotID
- the Pilot database IDdbName
- the database name- Returns:
- a List of EliteLifetime beans, sorted by recency
- Throws:
DAOException
- if a JDBC error occurs
-
getStatus
Loads a Pilot's most recent Elite status for a given year.- Parameters:
pilotID
- the Pilot's database IDyear
- the status year- Returns:
- an EliteStatus bean, or null
- Throws:
DAOException
- if a JDBC error occurs
-
getAllStatus
Loads a Pilot's Elite status updates for a particular year.- Parameters:
pilotID
- the Pilot's database IDyear
- the year- Returns:
- a List of EliteStatus beans, ordered by acheivement date
- Throws:
DAOException
- if a JDBC error occurs
-
getPilots
Loads all Pilots who have obtained a particular Elite status in a given year.- Parameters:
lvl
- the EliteLevel- Returns:
- a Collection of Pilot database IDs
- Throws:
DAOException
- if a JDBC error occurs
-
getPilots
Loads all Pilots who have obtained a particular lifetime Elite status.- Parameters:
el
- the EliteLifetime- Returns:
- a Collection of Pilot database IDs
- Throws:
DAOException
- if a JDBC error occurs
-
getPilotCount
Counts the number of Pilots who have achieved a given Elite status level.- Parameters:
lvl
- the EliteLevel- Returns:
- the number of Pilots
- Throws:
DAOException
- if a JDBC error occurs
-
getPilotCount
Counts the number of Pilots who have achieved a given lifetime Elite status level.- Parameters:
el
- the EliteLifetime- Returns:
- the number of Pilots
- Throws:
DAOException
- if a JDBC error occurs
-