Class GetAccomplishment

java.lang.Object
org.deltava.dao.DAO
org.deltava.dao.GetAccomplishment

public class GetAccomplishment extends DAO
A Data Access Object to load Accomplishment profiles.
Since:
3.2
Version:
9.1
Author:
Luke
  • Constructor Details

    • GetAccomplishment

      public GetAccomplishment(Connection c)
      Intiailizes the Data Access Object.
      Parameters:
      c - the JDBC connection to use
  • Method Details

    • get

      public Accomplishment get(int id) throws DAOException
      Returns an Accomplishment profile in the current airline.
      Parameters:
      id - the database ID
      Returns:
      an Accomplishment bean, or null if not found
      Throws:
      DAOException - if a JDBC error occurs
    • get

      public Accomplishment get(int id, String dbName) throws DAOException
      Returns an Accomplishment profile.
      Parameters:
      id - the database ID
      dbName - the database name
      Returns:
      an Accomplishment bean, or null if not found
      Throws:
      DAOException - if a JDBC error occurs
    • getByUnit

      public List<Accomplishment> getByUnit(AccomplishUnit u) throws DAOException
      Returns all Accomplishments involving a particular Unit of measure, order by value.
      Parameters:
      u - the AccomplishUnit
      Returns:
      a List of Accomplishment beans
      Throws:
      DAOException - if a JDBC error occurs
    • getAll

      public Collection<Accomplishment> getAll() throws DAOException
      Returns all Accomplishment profiles in the current database.
      Returns:
      a Collection of Accomplishment beans
      Throws:
      DAOException - if a JDBC error occurs
    • getByPilot

      public Collection<DatedAccomplishment> getByPilot(Pilot p, String dbName) throws DAOException
      Retrieves Accomplishments for a particular Pilot.
      Parameters:
      p - the Pilot
      dbName - the database name
      Returns:
      a Collection of DatedAccomplishment beans
      Throws:
      DAOException - if a JDBC error occurs
    • has

      public boolean has(int pilotID, Accomplishment a) throws DAOException
      Retruns whether a Pilot was awarded a particular Accomplishment.
      Parameters:
      pilotID - the Pilot database ID
      a - the Accomplishment bean
      Returns:
      TRUE if the Accomplishment was awarded, otherwise FALSE
      Throws:
      DAOException - if a JDBC error occurs
    • get

      public Map<Integer, Collection<DatedAccomplishment>> get(Map<Integer,Pilot> pilots, String dbName) throws DAOException
      Loads all accomplishments for a set of users.
      Parameters:
      pilots - a Map of Pilots, keyed by database ID
      dbName - the database name
      Returns:
      a Map of Collection of DatedAccomplishments, keyed by user's database ID
      Throws:
      DAOException - if a JDBC error occurs