org.deltava.dao
Class GetCachedRoutes

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

public class GetCachedRoutes
extends DAO

A Data Access Object to load cached external routes from the database.

Since:
2.6
Version:
2.6
Author:
Luke

Field Summary
 
Fields inherited from class org.deltava.dao.DAO
_ps, _queryMax, _queryStart, _queryTimeout
 
Constructor Summary
GetCachedRoutes(Connection c)
          Initializes the Data Access Object.
 
Method Summary
 int getAverageAge(Airport aD, Airport aA)
          Retrieves the average age of cached routes between two airports.
 Collection<? extends FlightRoute> getRoutes(Airport aD, Airport aA)
          Loads all the cached routes between two airports.
 
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

GetCachedRoutes

public GetCachedRoutes(Connection c)
Initializes the Data Access Object.

Parameters:
c - the JDBC connection to use
Method Detail

getAverageAge

public int getAverageAge(Airport aD,
                         Airport aA)
                  throws DAOException
Retrieves the average age of cached routes between two airports.

Parameters:
aD - the departure Airport bean
aA - the arrival Airport bean
Returns:
the average age in days, or -1 if none found
Throws:
DAOException - if a JDBC error occurs

getRoutes

public Collection<? extends FlightRoute> getRoutes(Airport aD,
                                                   Airport aA)
                                            throws DAOException
Loads all the cached routes between two airports.

Parameters:
aD - the departure Airport bean
aA - the arrival Airport bean
Returns:
a Collection of FlightRoute beans
Throws:
DAOException - if a JDBC error occurs


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