Class GetCachedRoutes
java.lang.Object
org.deltava.dao.DAO
org.deltava.dao.GetCachedRoutes
A Data Access Object to load cached external routes from the database.
- Since:
- 2.6
- Version:
- 11.1
- Author:
- Luke
-
Field Summary
Fields inherited from class org.deltava.dao.DAO
_queryMax, _queryStart, _queryTimeout, WGS84_SRID
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Retrieves the average age of cached routes between two airports.Collection
<? extends FlightRoute> Loads all the cached routes between two airports.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
-
GetCachedRoutes
Initializes the Data Access Object.- Parameters:
c
- the JDBC connection to use
-
-
Method Details
-
getAverageAge
Retrieves the average age of cached routes between two airports.- Parameters:
rp
- the RoutePair- Returns:
- the average age in days, or -1 if none found
- Throws:
DAOException
- if a JDBC error occurs
-
getRoutes
public Collection<? extends FlightRoute> getRoutes(RoutePair rp, boolean includeInternal) throws DAOException Loads all the cached routes between two airports.- Parameters:
rp
- the RoutePairincludeInternal
- TRUE to include internal routes, otherwise FALSE- Returns:
- a Collection of FlightRoute beans
- Throws:
DAOException
- if a JDBC error occurs
-